keycloak-scim/src/clients/routes/Clients.ts

23 lines
659 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 ClientsTab = "list" | "initialAccessToken";
export type ClientsParams = {
realm: string;
tab?: ClientsTab;
};
export const ClientsRoute: RouteDef = {
path: "/:realm/clients/:tab?",
2021-10-29 16:11:06 +00:00
component: lazy(() => import("../ClientsSection")),
breadcrumb: (t) => t("clients:clientList"),
access: "query-clients",
};
export const toClients = (params: ClientsParams): LocationDescriptorObject => ({
pathname: generatePath(ClientsRoute.path, params),
});