2021-10-29 16:11:06 +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";
|
2021-07-21 15:08:40 +00:00
|
|
|
import type { RouteDef } from "../../route-config";
|
|
|
|
|
|
|
|
export type AddClientParams = { realm: string };
|
|
|
|
|
2023-03-24 14:37:24 +00:00
|
|
|
const NewClientForm = lazy(() => import("../add/NewClientForm"));
|
|
|
|
|
2021-07-21 15:08:40 +00:00
|
|
|
export const AddClientRoute: RouteDef = {
|
|
|
|
path: "/:realm/clients/add-client",
|
2023-03-24 14:37:24 +00:00
|
|
|
element: <NewClientForm />,
|
2021-07-21 15:08:40 +00:00
|
|
|
breadcrumb: (t) => t("clients:createClient"),
|
2023-03-27 00:31:23 +00:00
|
|
|
handle: {
|
|
|
|
access: "manage-clients",
|
|
|
|
},
|
2021-07-21 15:08:40 +00:00
|
|
|
};
|
|
|
|
|
2022-08-19 18:05:09 +00:00
|
|
|
export const toAddClient = (params: AddClientParams): Partial<Path> => ({
|
2021-07-21 15:08:40 +00:00
|
|
|
pathname: generatePath(AddClientRoute.path, params),
|
|
|
|
});
|