2021-10-29 16:11:06 +00:00
|
|
|
import { lazy } from "react";
|
2022-08-19 18:05:09 +00:00
|
|
|
import type { Path } from "react-router-dom-v5-compat";
|
|
|
|
import { generatePath } from "react-router-dom-v5-compat";
|
2021-07-21 15:08:40 +00:00
|
|
|
import type { RouteDef } from "../../route-config";
|
|
|
|
|
|
|
|
export type CreateInitialAccessTokenParams = { realm: string };
|
|
|
|
|
|
|
|
export const CreateInitialAccessTokenRoute: RouteDef = {
|
|
|
|
path: "/:realm/clients/initialAccessToken/create",
|
2021-10-29 16:11:06 +00:00
|
|
|
component: lazy(() => import("../initial-access/CreateInitialAccessToken")),
|
2021-07-21 15:08:40 +00:00
|
|
|
breadcrumb: (t) => t("clients:createToken"),
|
|
|
|
access: "manage-clients",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const toCreateInitialAccessToken = (
|
|
|
|
params: CreateInitialAccessTokenParams
|
2022-08-19 18:05:09 +00:00
|
|
|
): Partial<Path> => ({
|
2021-07-21 15:08:40 +00:00
|
|
|
pathname: generatePath(CreateInitialAccessTokenRoute.path, params),
|
|
|
|
});
|