keycloak-scim/src/identity-providers/routes/IdentityProvider.ts

27 lines
813 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";
type IdentityProviderTabs = "settings" | "mappers";
export type IdentityProviderParams = {
realm: string;
providerId: string;
alias: string;
tab: IdentityProviderTabs;
};
export const IdentityProviderRoute: RouteDef = {
path: "/:realm/identity-providers/:providerId/:alias/:tab",
2021-10-29 16:11:06 +00:00
component: lazy(() => import("../add/DetailSettings")),
breadcrumb: (t) => t("identity-providers:providerDetails"),
access: "manage-identity-providers",
};
export const toIdentityProvider = (
params: IdentityProviderParams
): LocationDescriptorObject => ({
pathname: generatePath(IdentityProviderRoute.path, params),
});