2021-12-01 07:58:25 +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 ResourceDetailsParams = {
|
|
|
|
realm: string;
|
|
|
|
id: string;
|
|
|
|
resourceId?: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const ResourceDetailsRoute: RouteDef = {
|
2022-01-04 09:17:43 +00:00
|
|
|
path: "/:realm/clients/:id/authorization/resource/:resourceId?",
|
2021-12-01 07:58:25 +00:00
|
|
|
component: lazy(() => import("../authorization/ResourceDetails")),
|
|
|
|
breadcrumb: (t) => t("clients:createResource"),
|
|
|
|
access: "manage-clients",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const toResourceDetails = (
|
|
|
|
params: ResourceDetailsParams
|
|
|
|
): LocationDescriptorObject => ({
|
|
|
|
pathname: generatePath(ResourceDetailsRoute.path, params),
|
|
|
|
});
|