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

39 lines
915 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";
export type RealmSettingsTab =
| "general"
| "login"
| "email"
| "themes"
| "keys"
| "events"
| "localization"
| "securityDefences"
| "sessions"
| "tokens"
| "clientPolicies"
| "userProfile"
| "userRegistration";
export type RealmSettingsParams = {
realm: string;
tab?: RealmSettingsTab;
subTab?: string;
};
export const RealmSettingsRoute: RouteDef = {
path: "/:realm/realm-settings/:tab?/:subTab?",
2021-10-29 16:11:06 +00:00
component: lazy(() => import("../RealmSettingsSection")),
breadcrumb: (t) => t("realmSettings"),
access: "view-realm",
};
export const toRealmSettings = (
params: RealmSettingsParams
): LocationDescriptorObject => ({
pathname: generatePath(RealmSettingsRoute.path, params),
});