import {
  CategoryCell,
  CategoryHeader,
  ProductStatusCell,
  ProductStatusHeader
} from "./chunk-G64YUZSL.js";
import {
  ProductCell,
  ProductHeader
} from "./chunk-FWPGOIFA.js";
import {
  PlaceholderCell
} from "./chunk-PHOCVOZ5.js";

// src/hooks/table/columns/use-product-table-columns.tsx
import { createColumnHelper } from "@tanstack/react-table";
import { useMemo } from "react";

// src/components/table/table-cells/product/collection-cell/collection-cell.tsx
import { useTranslation } from "react-i18next";
import { jsx } from "react/jsx-runtime";
var CollectionCell = ({ collection }) => {
  if (!collection) {
    return /* @__PURE__ */ jsx(PlaceholderCell, {});
  }
  return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx("span", { className: "truncate", children: collection.title }) });
};
var CollectionHeader = () => {
  const { t } = useTranslation();
  return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx("span", { children: t("fields.collection") }) });
};

// src/components/table/table-cells/product/variant-cell/variant-cell.tsx
import { useTranslation as useTranslation2 } from "react-i18next";
import { jsx as jsx2 } from "react/jsx-runtime";
var VariantCell = ({ variants }) => {
  const { t } = useTranslation2();
  if (!variants || !variants.length) {
    return /* @__PURE__ */ jsx2(PlaceholderCell, {});
  }
  return /* @__PURE__ */ jsx2("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx2("span", { className: "truncate", children: t("products.variantCount", { count: variants.length }) }) });
};
var VariantHeader = () => {
  const { t } = useTranslation2();
  return /* @__PURE__ */ jsx2("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx2("span", { children: t("fields.variants") }) });
};

// src/hooks/table/columns/use-product-table-columns.tsx
import { jsx as jsx3 } from "react/jsx-runtime";
var columnHelper = createColumnHelper();
var useProductTableColumns = () => {
  return useMemo(
    () => [
      columnHelper.display({
        id: "product",
        header: () => /* @__PURE__ */ jsx3(ProductHeader, {}),
        cell: ({ row }) => /* @__PURE__ */ jsx3(ProductCell, { product: row.original })
      }),
      columnHelper.accessor("categories", {
        header: () => /* @__PURE__ */ jsx3(CategoryHeader, {}),
        cell: ({ row }) => /* @__PURE__ */ jsx3(CategoryCell, { categories: row.original.categories })
      }),
      columnHelper.accessor("collection", {
        header: () => /* @__PURE__ */ jsx3(CollectionHeader, {}),
        cell: ({ row }) => /* @__PURE__ */ jsx3(CollectionCell, { collection: row.original.collection })
      }),
      columnHelper.accessor("variants", {
        header: () => /* @__PURE__ */ jsx3(VariantHeader, {}),
        cell: ({ row }) => /* @__PURE__ */ jsx3(VariantCell, { variants: row.original.variants })
      }),
      columnHelper.accessor("status", {
        header: () => /* @__PURE__ */ jsx3(ProductStatusHeader, {}),
        cell: ({ row }) => /* @__PURE__ */ jsx3(ProductStatusCell, { status: row.original.status })
      })
    ],
    []
  );
};

export {
  useProductTableColumns
};
