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";
|
2023-03-27 14:10:48 +00:00
|
|
|
import type { AppRouteObject } from "../../routes";
|
2021-07-21 15:08:40 +00:00
|
|
|
|
|
|
|
export type AddClientParams = { realm: string };
|
|
|
|
|
2023-03-24 14:37:24 +00:00
|
|
|
const NewClientForm = lazy(() => import("../add/NewClientForm"));
|
|
|
|
|
2023-03-27 14:10:48 +00:00
|
|
|
export const AddClientRoute: AppRouteObject = {
|
2021-07-21 15:08:40 +00:00
|
|
|
path: "/:realm/clients/add-client",
|
2023-03-24 14:37:24 +00:00
|
|
|
element: <NewClientForm />,
|
2023-09-13 14:05:17 +00:00
|
|
|
breadcrumb: (t) => t("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),
|
|
|
|
});
|