keycloak-scim/src/realm-settings/routes/EditClientPolicy.ts

24 lines
747 B
TypeScript
Raw Normal View History

import type { LocationDescriptorObject } from "history";
2021-10-29 16:11:06 +00:00
import { lazy } from "react";
import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config";
import { EditPolicyCrumb } from "../RealmSettingsSection";
export type EditClientPolicyParams = {
realm: string;
policyName: string;
};
export const EditClientPolicyRoute: RouteDef = {
path: "/:realm/realm-settings/clientPolicies/:policyName/edit-policy",
2021-10-29 16:11:06 +00:00
component: lazy(() => import("../NewClientPolicyForm")),
access: "manage-realm",
breadcrumb: () => EditPolicyCrumb,
};
export const toEditClientPolicy = (
params: EditClientPolicyParams
): LocationDescriptorObject => ({
pathname: generatePath(EditClientPolicyRoute.path, params),
});