2023-01-09 12:57:40 +00:00
|
|
|
import { lazy } from "react";
|
2023-01-18 12:09:49 +00:00
|
|
|
import type { Path } from "react-router-dom";
|
|
|
|
import { generatePath } from "react-router-dom";
|
2023-01-09 12:57:40 +00:00
|
|
|
import type { RouteDef } from "../../route-config";
|
|
|
|
|
|
|
|
export type NewRoleParams = { realm: string; clientId: string };
|
|
|
|
|
|
|
|
export const NewRoleRoute: RouteDef = {
|
|
|
|
path: "/:realm/clients/:clientId/roles/new",
|
|
|
|
component: lazy(() => import("../roles/CreateClientRole")),
|
|
|
|
breadcrumb: (t) => t("roles:createRole"),
|
|
|
|
access: "manage-clients",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const toCreateRole = (params: NewRoleParams): Partial<Path> => ({
|
|
|
|
pathname: generatePath(NewRoleRoute.path, params),
|
|
|
|
});
|