import { jsxDEV } from "react/jsx-dev-runtime";
import { useProjectSlug } from "@contember/react-client";
import { LayoutPage, Heading } from "@contember/ui";
import { createNotInProjectError } from "./errors.js";
import { useRoleRendererFactory, UsersList } from "../person/UsersList.js";
import { LinkButton } from "../../../routing/LinkButton.js";
const UserListPage = (props) => {
  const project = useProjectSlug();
  const roleRendererFactory = useRoleRendererFactory(props);
  if (!project) {
    throw createNotInProjectError();
  }
  return /* @__PURE__ */ jsxDEV(
    LayoutPage,
    {
      actions: /* @__PURE__ */ jsxDEV(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__ */ jsxDEV(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__ */ jsxDEV(
        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;
export {
  UserListPage,
  UsersManagement
};
//# sourceMappingURL=UserListPage.js.map
