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

23 lines
691 B
TypeScript
Raw Normal View History

import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config";
export type AttributeParams = {
realm: string;
attributeName: string;
};
export const AttributeRoute: RouteDef = {
2022-06-22 11:35:10 +00:00
path: "/:realm/realm-settings/user-profile/attributes/:attributeName/edit-attribute",
component: lazy(() => import("../NewAttributeSettings")),
breadcrumb: (t) => t("realm-settings:editAttribute"),
access: "manage-realm",
};
export const toAttribute = (
params: AttributeParams
): LocationDescriptorObject => ({
pathname: generatePath(AttributeRoute.path, params),
});