"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const ui = require("@contember/ui");
const QueryLoader = require("../QueryLoader.cjs");
const auth = require("../../lib/auth.cjs");
const LinkButton = require("../../../routing/LinkButton.cjs");
const ProjectsGrid = ({ projectDetailLink }) => {
  const { state: query } = auth.useAuthedTenantQuery(
    `
		query {
			projects {
				slug
				name
			}
		}`,
    {}
  );
  return /* @__PURE__ */ jsxDevRuntime.jsxDEV(QueryLoader.QueryLoader, { query, children: ({ query: query2 }) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(
    ui.Table,
    {
      tableHead: /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.TableRow, { children: [
        /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.TableHeaderCell, { children: "Name" }, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
          lineNumber: 27,
          columnNumber: 7
        }, void 0),
        /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.TableHeaderCell, { children: "Slug" }, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
          lineNumber: 28,
          columnNumber: 7
        }, void 0),
        /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.TableHeaderCell, {}, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
          lineNumber: 29,
          columnNumber: 7
        }, void 0)
      ] }, void 0, true, {
        fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
        lineNumber: 26,
        columnNumber: 17
      }, void 0),
      children: query2.data?.projects.map((project) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.TableRow, { children: [
        /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.TableCell, { children: project.name }, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
          lineNumber: 34,
          columnNumber: 8
        }, void 0),
        /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.TableCell, { children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("span", { style: { fontFamily: "monospace" }, children: project.slug }, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
          lineNumber: 36,
          columnNumber: 9
        }, void 0) }, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
          lineNumber: 35,
          columnNumber: 8
        }, void 0),
        /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.TableCell, { shrunk: true, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(LinkButton.LinkButton, { to: projectDetailLink, parameters: { projectSlug: project.slug }, children: "Overview and users" }, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
          lineNumber: 39,
          columnNumber: 9
        }, void 0) }, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
          lineNumber: 38,
          columnNumber: 8
        }, void 0)
      ] }, project.slug, true, {
        fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
        lineNumber: 33,
        columnNumber: 7
      }, void 0))
    },
    void 0,
    false,
    {
      fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
      lineNumber: 25,
      columnNumber: 5
    },
    void 0
  ) }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/tenant/components/project/ProjectsGrid.tsx",
    lineNumber: 23,
    columnNumber: 3
  }, void 0);
};
exports.ProjectsGrid = ProjectsGrid;
//# sourceMappingURL=ProjectsGrid.cjs.map
