import {
  Pagination
} from "/build/_shared/chunk-66K6NTQO.js";
import {
  SquareArrowUpRight
} from "/build/_shared/chunk-7FHGZRTC.js";
import {
  Badge,
  idShortener
} from "/build/_shared/chunk-634BMO4L.js";
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow
} from "/build/_shared/chunk-P3C75TI5.js";
import {
  init_esm2 as init_esm,
  useNavigate,
  useParams
} from "/build/_shared/chunk-ZC2TL3GZ.js";
import {
  require_jsx_dev_runtime
} from "/build/_shared/chunk-ED7KKCRB.js";
import {
  Routes
} from "/build/_shared/chunk-N27UEDHN.js";
import {
  createHotContext,
  init_remix_hmr
} from "/build/_shared/chunk-G7KTOMTD.js";
import {
  __toESM
} from "/build/_shared/chunk-PNG5AS42.js";

// app/pages/experiments/ExperimentsTable.tsx
init_remix_hmr();

// app/pages/experiments/ExperimentCell.tsx
init_remix_hmr();
init_esm();
var import_jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/pages/experiments/ExperimentCell.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
var _s = $RefreshSig$();
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/experiments/ExperimentCell.tsx"
  );
  import.meta.hot.lastModified = "1711753014540.865";
}
var ExperimentCell = ({
  experiment
}) => {
  _s();
  const navigate = useNavigate();
  const params = useParams();
  const {
    short,
    variant
  } = idShortener(experiment.id);
  const onCellClick = (experiment2) => {
    navigate(Routes.app.project.env.experimentsId({
      projectId: params.projectId,
      envId: params.envId,
      experimentId: experiment2.id
    }));
  };
  return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(TableRow, { children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Badge, { variant, className: "cursor-pointer", onClick: () => {
      onCellClick(experiment);
    }, children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(SquareArrowUpRight, {}, void 0, false, {
        fileName: "app/pages/experiments/ExperimentCell.tsx",
        lineNumber: 50,
        columnNumber: 11
      }, this),
      "\xA0",
      short
    ] }, void 0, true, {
      fileName: "app/pages/experiments/ExperimentCell.tsx",
      lineNumber: 47,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "app/pages/experiments/ExperimentCell.tsx",
      lineNumber: 46,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(TableCell, { children: experiment.name }, void 0, false, {
      fileName: "app/pages/experiments/ExperimentCell.tsx",
      lineNumber: 55,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(TableCell, { children: experiment.description }, void 0, false, {
      fileName: "app/pages/experiments/ExperimentCell.tsx",
      lineNumber: 56,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(TableCell, { children: experiment.createdAt }, void 0, false, {
      fileName: "app/pages/experiments/ExperimentCell.tsx",
      lineNumber: 57,
      columnNumber: 7
    }, this)
  ] }, experiment.id, true, {
    fileName: "app/pages/experiments/ExperimentCell.tsx",
    lineNumber: 45,
    columnNumber: 10
  }, this);
};
_s(ExperimentCell, "SzNGDGP4xGcYIk3uBFNVGGb4h2M=", false, function() {
  return [useNavigate, useParams];
});
_c = ExperimentCell;
var _c;
$RefreshReg$(_c, "ExperimentCell");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/pages/experiments/ExperimentsTable.tsx
var import_jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/pages/experiments/ExperimentsTable.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/experiments/ExperimentsTable.tsx"
  );
  import.meta.hot.lastModified = "1711663831018.629";
}
var ExperimentsTable = ({
  experiments,
  currentPage,
  totalCount,
  totalPages
}) => {
  const showPagination = !!totalCount && currentPage && totalPages;
  return /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { children: [
    showPagination && /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "mb-2 flex justify-between", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("span", { className: "text-muted-foreground text-sm", children: [
        totalCount,
        " experiment",
        totalCount >= 2 ? "s" : ""
      ] }, void 0, true, {
        fileName: "app/pages/experiments/ExperimentsTable.tsx",
        lineNumber: 34,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "app/pages/experiments/ExperimentsTable.tsx",
        lineNumber: 33,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Pagination, { currentPage, totalPages }, void 0, false, {
        fileName: "app/pages/experiments/ExperimentsTable.tsx",
        lineNumber: 38,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/experiments/ExperimentsTable.tsx",
      lineNumber: 32,
      columnNumber: 26
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Table, { children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(TableRow, { children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(TableHead, { children: "ID" }, void 0, false, {
          fileName: "app/pages/experiments/ExperimentsTable.tsx",
          lineNumber: 43,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(TableHead, { children: "Name" }, void 0, false, {
          fileName: "app/pages/experiments/ExperimentsTable.tsx",
          lineNumber: 44,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(TableHead, { children: "Description" }, void 0, false, {
          fileName: "app/pages/experiments/ExperimentsTable.tsx",
          lineNumber: 45,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(TableHead, { children: "Created On" }, void 0, false, {
          fileName: "app/pages/experiments/ExperimentsTable.tsx",
          lineNumber: 46,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "app/pages/experiments/ExperimentsTable.tsx",
        lineNumber: 42,
        columnNumber: 11
      }, this) }, void 0, false, {
        fileName: "app/pages/experiments/ExperimentsTable.tsx",
        lineNumber: 41,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(TableBody, { children: experiments.length ? experiments.map((experiment) => /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(ExperimentCell, { experiment }, experiment.id, false, {
        fileName: "app/pages/experiments/ExperimentsTable.tsx",
        lineNumber: 50,
        columnNumber: 63
      }, this)) : /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(TableCell, { colSpan: 4, className: "h-24 text-center", children: "No experiments." }, void 0, false, {
        fileName: "app/pages/experiments/ExperimentsTable.tsx",
        lineNumber: 51,
        columnNumber: 15
      }, this) }, void 0, false, {
        fileName: "app/pages/experiments/ExperimentsTable.tsx",
        lineNumber: 50,
        columnNumber: 129
      }, this) }, void 0, false, {
        fileName: "app/pages/experiments/ExperimentsTable.tsx",
        lineNumber: 49,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/experiments/ExperimentsTable.tsx",
      lineNumber: 40,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "app/pages/experiments/ExperimentsTable.tsx",
    lineNumber: 31,
    columnNumber: 10
  }, this);
};
_c2 = ExperimentsTable;
var _c2;
$RefreshReg$(_c2, "ExperimentsTable");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

export {
  ExperimentsTable
};
//# sourceMappingURL=/build/_shared/chunk-EWUZNH5A.js.map
