import { jsxDEV } from "react/jsx-dev-runtime";
import { useProjectSlug } from "@contember/react-client";
import { createNotInProjectError } from "./errors.js";
import { LayoutPage } from "@contember/ui";
import { useRoleRendererFactory, UsersList } from "../person/UsersList.js";
import { LinkButton } from "../../../routing/binding/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
      }, globalThis),
      title: "Users in project",
      children: /* @__PURE__ */ jsxDEV(
        UsersList,
        {
          project,
          createRoleRenderer: roleRendererFactory,
          editUserLink: props.editUserLink ?? `tenantEditUser(id: $id)`
        },
        void 0,
        false,
        {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/pages/UserListPage.tsx",
          lineNumber: 28,
          columnNumber: 4
        },
        globalThis
      )
    },
    void 0,
    false,
    {
      fileName: "/__w/interface/interface/packages/admin/src/tenant/components/pages/UserListPage.tsx",
      lineNumber: 24,
      columnNumber: 3
    },
    globalThis
  );
};
const UsersManagement = UserListPage;
export {
  UserListPage,
  UsersManagement
};
//# sourceMappingURL=UserListPage.js.map
