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