import type { OrderStatus, PaymentStatus } from "./types";

export const ORDERS_PATH = "/account/orders";
export const ORDERS_PAGE_SIZE = 10;
export const CANCELLABLE_STATUSES = ["confirmed"] as const;
export const RETURNABLE_STATUSES = ["delivered"] as const;

export const ORDER_STATUS_CONFIG: Record<
  OrderStatus,
  { label: string; colorClass: string; chipVariant: string }
> = {
  pending: {
    label: "Pending",
    colorClass: "bg-gray-100 text-gray-600",
    chipVariant: "default",
  },
  confirmed: {
    label: "Confirmed",
    colorClass: "bg-[#e8f7f6] text-[#236f6b]",
    chipVariant: "default",
  },
  processing: {
    label: "Processing",
    colorClass: "bg-[#fde8c8] text-[#b36a10]",
    chipVariant: "default",
  },
  shipped: {
    label: "Shipped",
    colorClass: "bg-blue-50 text-blue-700",
    chipVariant: "default",
  },
  delivered: {
    label: "Delivered",
    colorClass: "bg-green-50 text-green-700",
    chipVariant: "default",
  },
  cancelled: {
    label: "Cancelled",
    colorClass: "bg-gray-100 text-gray-500",
    chipVariant: "default",
  },
  refunded: {
    label: "Refunded",
    colorClass: "bg-[#fce0da] text-[#f2705a]",
    chipVariant: "default",
  },
  return: {
    label: "Return Requested",
    colorClass: "bg-orange-50 text-orange-700",
    chipVariant: "default",
  },
  completed: {
    label: "Completed",
    colorClass: "bg-teal-50 text-teal-700",
    chipVariant: "default",
  },
};

export const PAYMENT_STATUS_CONFIG: Record<
  PaymentStatus,
  { label: string; colorClass: string; chipVariant: string }
> = {
  pending: {
    label: "Awaiting Payment",
    colorClass: "bg-gray-100 text-gray-600",
    chipVariant: "default",
  },
  paid: {
    label: "Paid",
    colorClass: "bg-green-50 text-green-700",
    chipVariant: "default",
  },
  failed: {
    label: "Payment Failed",
    colorClass: "bg-[#fce0da] text-[#f2705a]",
    chipVariant: "default",
  },
  refunded: {
    label: "Refunded",
    colorClass: "bg-[#fde8c8] text-[#b36a10]",
    chipVariant: "default",
  },
};

export const ORDER_TAB_FILTERS: Array<{
  id: string;
  label: string;
  statuses?: OrderStatus[];
}> = [
  { id: "all", label: "All Orders" },
  {
    id: "active",
    label: "Active",
    statuses: ["confirmed", "processing", "shipped"],
  },
  { id: "delivered", label: "Delivered", statuses: ["delivered"] },
  {
    id: "cancelled",
    label: "Cancelled",
    statuses: ["cancelled", "refunded"],
  },
];
