2022-01-04 09:17:43 +00:00
|
|
|
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"),
|
2022-05-30 09:23:24 +00:00
|
|
|
access: "view-clients",
|
2022-01-04 09:17:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const toNewScope = (
|
|
|
|
params: NewScopeParams
|
|
|
|
): LocationDescriptorObject => ({
|
|
|
|
pathname: generatePath(NewScopeRoute.path, params),
|
|
|
|
});
|