keycloak-scim/src/clients/routes/NewScope.ts
2022-05-30 11:23:24 +02:00

19 lines
647 B
TypeScript

import type { LocationDescriptorObject } from "history";
import type { RouteDef } from "../../route-config";
import { generatePath } from "react-router-dom";
import { lazy } from "react";
export type NewScopeParams = { realm: string; id: string };
export const NewScopeRoute: RouteDef = {
path: "/:realm/clients/:id/authorization/scope/new",
component: lazy(() => import("../authorization/ScopeDetails")),
breadcrumb: (t) => t("clients:createAuthorizationScope"),
access: "view-clients",
};
export const toNewScope = (
params: NewScopeParams
): LocationDescriptorObject => ({
pathname: generatePath(NewScopeRoute.path, params),
});