"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const reactClient = require("@contember/react-client");
const ui = require("@contember/ui");
const errors = require("./errors.cjs");
const UsersList = require("../person/UsersList.cjs");
const LinkButton = require("../../../routing/LinkButton.cjs");
const UserListPage = (props) => {
  const project = reactClient.useProjectSlug();
  const roleRendererFactory = UsersList.useRoleRendererFactory(props);
  if (!project) {
    throw errors.createNotInProjectError();
  }
  return /* @__PURE__ */ jsxRuntime.jsx(
    ui.LayoutPage,
    {
      actions: /* @__PURE__ */ jsxRuntime.jsx(LinkButton.LinkButton, { to: props.addUserLink ?? "tenantInviteUser", children: "Add a user" }),
      title: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { depth: 1, children: "Users" }),
      children: /* @__PURE__ */ jsxRuntime.jsx(
        UsersList.UsersList,
        {
          project,
          createRoleRenderer: roleRendererFactory,
          editUserLink: props.editUserLink ?? `tenantEditUser(id: $identityId)`
        }
      )
    }
  );
};
const UsersManagement = UserListPage;
exports.UserListPage = UserListPage;
exports.UsersManagement = UsersManagement;
//# sourceMappingURL=UserListPage.cjs.map
