import { jsxDEV } from "react/jsx-dev-runtime";
import { Table, TableRow, TableHeaderCell, TableCell } from "@contember/ui";
import { QueryLoader } from "../QueryLoader.js";
import { useAuthedTenantQuery } from "../../lib/auth.js";
import { LinkButton } from "../../../routing/LinkButton.js";
const ProjectsGrid = ({ projectDetailLink }) => {
  const { state: query } = useAuthedTenantQuery(
    `
		query {
			projects {
				slug
				name
			}
		}`,
    {}
  );
  return /* @__PURE__ */ jsxDEV(QueryLoader, { query, children: ({ query: query2 }) => /* @__PURE__ */ jsxDEV(
    Table,
    {
      tableHead: /* @__PURE__ */ jsxDEV(TableRow, { children: [
        /* @__PURE__ */ jsxDEV(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__ */ jsxDEV(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__ */ jsxDEV(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__ */ jsxDEV(TableRow, { children: [
        /* @__PURE__ */ jsxDEV(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__ */ jsxDEV(TableCell, { children: /* @__PURE__ */ 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__ */ jsxDEV(TableCell, { shrunk: true, children: /* @__PURE__ */ jsxDEV(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);
};
export {
  ProjectsGrid
};
//# sourceMappingURL=ProjectsGrid.js.map
