keycloak-scim/src/user-federation/routes/NewLdapUserFederation.ts

19 lines
702 B
TypeScript

import type { LocationDescriptorObject } from "history";
import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config";
import { UserFederationLdapSettings } from "../UserFederationLdapSettings";
export type NewLdapUserFederationParams = { realm: string };
export const NewLdapUserFederationRoute: RouteDef = {
path: "/:realm/user-federation/ldap/new",
component: UserFederationLdapSettings,
breadcrumb: (t) => t("user-federation:addOneLdap"),
access: "view-realm",
};
export const toNewLdapUserFederation = (
params: NewLdapUserFederationParams
): LocationDescriptorObject => ({
pathname: generatePath(NewLdapUserFederationRoute.path, params),
});