import { jsx } from "react/jsx-runtime";
import { useProjectSlug } from "@contember/react-client";
import { LayoutPage, Heading } from "@contember/ui";
import { memo } from "react";
import { createNotInProjectError } from "./errors.js";
import { NavigateBackButton } from "../../../routing/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: /* @__PURE__ */ jsx(Heading, { depth: 1, children: "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
