keycloak-scim/apps/admin-ui/src/clients/routes/AuthenticationTab.ts

32 lines
824 B
TypeScript
Raw Normal View History

import { lazy } from "react";
import type { Path } from "react-router-dom-v5-compat";
import { generatePath } from "react-router-dom-v5-compat";
import type { RouteDef } from "../../route-config";
export type AuthorizationTab =
| "settings"
| "resources"
| "scopes"
| "policies"
| "permissions"
| "evaluate"
| "export";
export type AuthorizationParams = {
realm: string;
clientId: string;
tab: AuthorizationTab;
};
export const AuthorizationRoute: RouteDef = {
path: "/:realm/clients/:clientId/authorization/:tab",
component: lazy(() => import("../ClientDetails")),
breadcrumb: (t) => t("clients:clientSettings"),
access: "view-clients",
};
export const toAuthorizationTab = (
params: AuthorizationParams
): Partial<Path> => ({
pathname: generatePath(AuthorizationRoute.path, params),
});