import { memo } from "react";
import { useProjectSlug } from "@contember/react-client";
import { LayoutPage } from "@contember/ui";
import { createNotInProjectError } from "./errors.js";
import { jsx } from "react/jsx-runtime";
import { NavigateBackButton } from "../../../routing/binding/NavigateBackButton.js";
import { InviteUser } from "../person/InviteUser.js";
const InviteUserPage = memo(({
  rolesConfig,
  userListLink = "tenantUsers",
  method
}) => {
  const project = useProjectSlug();
  if (!project) {
    throw createNotInProjectError();
  }
  return /* @__PURE__ */ jsx(LayoutPage, {
    title: "Invite user",
    navigation: /* @__PURE__ */ jsx(NavigateBackButton, {
      to: userListLink,
      children: "Back to list of users"
    }),
    children: /* @__PURE__ */ jsx(InviteUser, {
      project,
      rolesConfig,
      userListLink,
      method
    })
  });
});
const InviteUserToProject = InviteUserPage;
export {
  InviteUserPage,
  InviteUserToProject
};
//# sourceMappingURL=InviteUserPage.js.map
