2021-07-26 13:40:23 +00:00
|
|
|
import type { LocationDescriptorObject } from "history";
|
2021-10-29 16:11:06 +00:00
|
|
|
import { lazy } from "react";
|
2021-07-26 13:40:23 +00:00
|
|
|
import { generatePath } from "react-router-dom";
|
|
|
|
import type { RouteDef } from "../../route-config";
|
|
|
|
|
|
|
|
export type GroupsParams = { realm: string };
|
|
|
|
|
|
|
|
export const GroupsRoute: RouteDef = {
|
|
|
|
path: "/:realm/groups",
|
2021-10-29 16:11:06 +00:00
|
|
|
component: lazy(() => import("../GroupsSection")),
|
2021-07-26 13:40:23 +00:00
|
|
|
access: "query-groups",
|
|
|
|
matchOptions: {
|
|
|
|
exact: false,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const toGroups = (params: GroupsParams): LocationDescriptorObject => ({
|
|
|
|
pathname: generatePath(GroupsRoute.path, params),
|
|
|
|
});
|