import {
  StatusCell
} from "./chunk-DB6ANJBO.js";

// src/lib/order-helpers.ts
var getCanceledOrderStatus = (t, status) => {
  if (status === "canceled") {
    return { label: t("orders.status.canceled"), color: "red" };
  }
  return null;
};
var getOrderPaymentStatus = (t, status) => {
  const statusMap = {
    not_paid: [t("orders.payment.status.notPaid"), "red"],
    authorized: [t("orders.payment.status.authorized"), "orange"],
    partially_authorized: [
      t("orders.payment.status.partiallyAuthorized"),
      "red"
    ],
    awaiting: [t("orders.payment.status.awaiting"), "orange"],
    captured: [t("orders.payment.status.captured"), "green"],
    refunded: [t("orders.payment.status.refunded"), "red"],
    partially_refunded: [
      t("orders.payment.status.partiallyRefunded"),
      "orange"
    ],
    partially_captured: [
      t("orders.payment.status.partiallyCaptured"),
      "orange"
    ],
    canceled: [t("orders.payment.status.canceled"), "red"],
    requires_action: [t("orders.payment.status.requiresAction"), "orange"]
  };
  const [label, color] = statusMap[status] ?? [status ?? "-", "red"];
  return { label, color };
};
var getOrderFulfillmentStatus = (t, status) => {
  const statusMap = {
    not_fulfilled: [t("orders.fulfillment.status.notFulfilled"), "red"],
    partially_fulfilled: [
      t("orders.fulfillment.status.partiallyFulfilled"),
      "orange"
    ],
    fulfilled: [t("orders.fulfillment.status.fulfilled"), "green"],
    partially_shipped: [
      t("orders.fulfillment.status.partiallyShipped"),
      "orange"
    ],
    shipped: [t("orders.fulfillment.status.shipped"), "green"],
    delivered: [t("orders.fulfillment.status.delivered"), "green"],
    partially_delivered: [
      t("orders.fulfillment.status.partiallyDelivered"),
      "orange"
    ],
    partially_returned: [
      t("orders.fulfillment.status.partiallyReturned"),
      "orange"
    ],
    returned: [t("orders.fulfillment.status.returned"), "green"],
    canceled: [t("orders.fulfillment.status.canceled"), "red"],
    requires_action: [t("orders.fulfillment.status.requiresAction"), "orange"]
  };
  const [label, color] = statusMap[status] ?? [status ?? "-", "red"];
  return { label, color };
};

// src/components/table/table-cells/order/payment-status-cell/payment-status-cell.tsx
import { useTranslation } from "react-i18next";
import { jsx } from "react/jsx-runtime";
var PaymentStatusCell = ({ status }) => {
  const { t } = useTranslation();
  const { label, color } = getOrderPaymentStatus(t, status);
  return /* @__PURE__ */ jsx(StatusCell, { color, children: label });
};
var PaymentStatusHeader = () => {
  const { t } = useTranslation();
  return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx("span", { className: "truncate", children: t("fields.payment") }) });
};

// src/components/table/table-cells/order/fulfillment-status-cell/fulfillment-status-cell.tsx
import { useTranslation as useTranslation2 } from "react-i18next";
import { jsx as jsx2 } from "react/jsx-runtime";
var FulfillmentStatusCell = ({
  status
}) => {
  const { t } = useTranslation2();
  if (!status) {
    return "-";
  }
  const { label, color } = getOrderFulfillmentStatus(t, status);
  return /* @__PURE__ */ jsx2(StatusCell, { color, children: label });
};
var FulfillmentStatusHeader = () => {
  const { t } = useTranslation2();
  return /* @__PURE__ */ jsx2("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx2("span", { className: "truncate", children: t("fields.fulfillment") }) });
};

export {
  getCanceledOrderStatus,
  getOrderPaymentStatus,
  getOrderFulfillmentStatus,
  PaymentStatusCell,
  PaymentStatusHeader,
  FulfillmentStatusCell,
  FulfillmentStatusHeader
};
