import {
  StatusCell
} from "./chunk-DB6ANJBO.js";
import {
  PlaceholderCell
} from "./chunk-PHOCVOZ5.js";
import {
  require_dist
} from "./chunk-52KJSIHS.js";
import {
  __toESM
} from "./chunk-NBMM2TZK.js";

// src/components/table/table-cells/product/category-cell/category-cell.tsx
import { Tooltip } from "@medusajs/ui";
import { useTranslation } from "react-i18next";
import { jsx, jsxs } from "react/jsx-runtime";
var CategoryCell = ({ categories }) => {
  const { t } = useTranslation();
  if (!categories || !categories.length) {
    return /* @__PURE__ */ jsx(PlaceholderCell, {});
  }
  const [first, ...rest] = categories;
  return /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full items-center gap-x-1 overflow-hidden", children: [
    /* @__PURE__ */ jsx("span", { title: first.name, className: "truncate", children: first.name }),
    rest.length > 0 && /* @__PURE__ */ jsx(
      Tooltip,
      {
        content: /* @__PURE__ */ jsx("ul", { children: rest.map((c) => /* @__PURE__ */ jsx("li", { children: c.name }, c.id)) }),
        children: /* @__PURE__ */ jsx("span", { className: "text-ui-fg-subtle txt-compact-small", children: t("general.plusCountMore", { count: rest.length }) })
      }
    )
  ] });
};
var CategoryHeader = () => {
  const { t } = useTranslation();
  return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx("span", { children: t("fields.category") }) });
};

// src/components/table/table-cells/product/product-status-cell/product-status-cell.tsx
import { useTranslation as useTranslation2 } from "react-i18next";
var import_types = __toESM(require_dist(), 1);
import { jsx as jsx2 } from "react/jsx-runtime";
var ProductStatusCell = ({ status }) => {
  const { t } = useTranslation2();
  const [color, text] = {
    [import_types.ProductStatus.DRAFT]: ["grey", t("products.productStatus.draft")],
    [import_types.ProductStatus.PROPOSED]: ["orange", t("products.productStatus.proposed")],
    [import_types.ProductStatus.PUBLISHED]: ["green", t("products.productStatus.published")],
    [import_types.ProductStatus.REJECTED]: ["red", t("products.productStatus.rejected")]
  }[status];
  return /* @__PURE__ */ jsx2(StatusCell, { color, children: text });
};
var ProductStatusHeader = () => {
  const { t } = useTranslation2();
  return /* @__PURE__ */ jsx2("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx2("span", { children: t("fields.status") }) });
};

export {
  CategoryCell,
  CategoryHeader,
  ProductStatusCell,
  ProductStatusHeader
};
