"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-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__ */ jsxDevRuntime.jsxDEV(
    ui.LayoutPage,
    {
      actions: /* @__PURE__ */ jsxDevRuntime.jsxDEV(LinkButton.LinkButton, { to: props.addUserLink ?? "tenantInviteUser", children: "Add a user" }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/tenant/components/pages/UserListPage.tsx",
        lineNumber: 25,
        columnNumber: 13
      }, void 0),
      title: /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.Heading, { depth: 1, children: "Users" }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/tenant/components/pages/UserListPage.tsx",
        lineNumber: 26,
        columnNumber: 11
      }, void 0),
      children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(
        UsersList.UsersList,
        {
          project,
          createRoleRenderer: roleRendererFactory,
          editUserLink: props.editUserLink ?? `tenantEditUser(id: $identityId)`
        },
        void 0,
        false,
        {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/pages/UserListPage.tsx",
          lineNumber: 28,
          columnNumber: 4
        },
        void 0
      )
    },
    void 0,
    false,
    {
      fileName: "/__w/interface/interface/packages/admin/src/tenant/components/pages/UserListPage.tsx",
      lineNumber: 24,
      columnNumber: 3
    },
    void 0
  );
};
const UsersManagement = UserListPage;
exports.UserListPage = UserListPage;
exports.UsersManagement = UsersManagement;
//# sourceMappingURL=UserListPage.cjs.map
