import { Shield, ClipboardList, CheckSquare, CalendarIcon } from "lucide-react";
import { format } from "date-fns";

export const columns: ColumnDefinition[] = [
  // Hidden by default
  {
    key: "id",
    title: "ID",
    type: "text",
    icon: Shield,
    sortable: true,
    searchable: true,
    filterable: true,
    description: "Unique shipping identifier",
    priority: 3,
    expandedOnly: true,
  },
  {
    key: "description",
    title: "Description",
    type: "text",
    icon: ClipboardList,
    sortable: false,
    searchable: true,
    filterable: false,
    editable: true,
    usedInCreate: true,
    description: "Shipping description",
    priority: 3,
    expandedOnly: true,
  },
  {
    key: "cost",
    title: "Cost",
    type: "number",
    icon: ClipboardList,
    sortable: true,
    searchable: false,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Shipping cost",
    priority: 3,
    expandedOnly: true,
  },
  {
    key: "tax",
    title: "Tax",
    type: "number",
    icon: ClipboardList,
    sortable: true,
    searchable: false,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Shipping tax",
    priority: 3,
    expandedOnly: true,
  },

  // Shown by default
  {
    key: "loadId",
    title: "Load ID",
    type: "text",
    icon: ClipboardList,
    sortable: true,
    searchable: true,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Shipping load ID",
    priority: 1,
  },
  {
    key: "loadStatus",
    title: "Status",
    type: "select",
    icon: CheckSquare,
    sortable: true,
    searchable: true,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "PENDING, TRANSIT, DELIVERED, CANCELLED",
    options: [
      { value: "PENDING", label: "Pending" },
      { value: "TRANSIT", label: "Transit" },
      { value: "DELIVERED", label: "Delivered" },
      { value: "CANCELLED", label: "Cancelled" },
    ],
    priority: 1,
  },
  {
    key: "shipper",
    title: "Shipper",
    type: "text",
    icon: ClipboardList,
    sortable: true,
    searchable: true,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Name of the shipper",
    priority: 1,
  },
  {
    key: "transporter",
    title: "Transporter",
    type: "text",
    icon: ClipboardList,
    sortable: true,
    searchable: true,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Name of the transporter",
    priority: 1,
  },
  {
    key: "goodsType",
    title: "Goods Type",
    type: "text",
    icon: ClipboardList,
    sortable: true,
    searchable: true,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Type of goods",
    priority: 2,
  },
  {
    key: "weight",
    title: "Weight",
    type: "number",
    icon: ClipboardList,
    sortable: true,
    searchable: false,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Goods weight",
    priority: 2,
  },
  {
    key: "volume",
    title: "Volume",
    type: "number",
    icon: ClipboardList,
    sortable: true,
    searchable: false,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Goods volume",
    priority: 2,
  },
  {
    key: "vehicle",
    title: "Vehicle",
    type: "text",
    icon: ClipboardList,
    sortable: true,
    searchable: true,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Vehicle used",
    priority: 2,
  },
  {
    key: "deliveryDate",
    title: "Delivery Date",
    type: "date",
    icon: CalendarIcon,
    sortable: true,
    searchable: true,
    filterable: true,
    editable: true,
    usedInCreate: true,
    description: "Expected delivery date",
    render: { type: "date", format: "PPP" },
    priority: 2,
    expandedOnly: true,
  },
];
