import {
  Shield,
  User,
  DollarSign,
  ClipboardList,
  CalendarIcon,
} from "lucide-react";

export const columns: ColumnDefinition[] = [
  {
    key: "id",
    title: "ID",
    type: "text",
    icon: Shield,
    sortable: true,
    searchable: true,
    filterable: true,
    description: "Unique order identifier",
    priority: 2,
    expandedOnly: true,
  },
  {
    key: "user",
    title: "User",
    type: "compound",
    icon: User,
    sortable: true,
    searchable: true,
    filterable: true,
    description: "Investor details",
    render: {
      type: "compound",
      config: {
        image: {
          key: "avatar",
          fallback: "/img/placeholder.svg",
          type: "image",
          title: "Avatar",
          description: "User avatar",
          editable: false,
          usedInCreate: false,
        },
        primary: {
          key: ["firstName", "lastName"],
          title: ["First Name", "Last Name"],
          description: ["Investor's first name", "Investor's last name"],
          editable: false,
          usedInCreate: false,
          icon: User,
        },
        secondary: {
          key: "email",
          title: "Email",
          icon: ClipboardList,
          editable: false,
          usedInCreate: false,
        },
      },
    },
    priority: 1,
    expandedOnly: true,
  },
  {
    key: "symbol",
    title: "Symbol",
    type: "text",
    sortable: true,
    searchable: true,
    filterable: true,
    description: "Trading symbol",
    priority: 1,
  },
  {
    key: "price",
    title: "Price",
    type: "number",
    icon: DollarSign,
    sortable: true,
    searchable: false,
    filterable: true,
    description: "Entry price",
    priority: 1,
  },
  {
    key: "amount",
    title: "Amount",
    type: "number",
    sortable: true,
    searchable: false,
    filterable: true,
    description: "Order amount",
    priority: 1,
  },
  {
    key: "profit",
    title: "Profit",
    type: "number",
    sortable: true,
    searchable: false,
    filterable: true,
    description: "Profit earned",
    priority: 1,
  },
  {
    key: "side",
    title: "Side",
    type: "select",
    sortable: true,
    searchable: true,
    filterable: true,
    description: "Order side",
    options: [
      { value: "RISE", label: "Rise" },
      { value: "FALL", label: "Fall" },
      // { value: "HIGHER", label: "Higher" },
      // { value: "LOWER", label: "Lower" },
      // { value: "TOUCH", label: "Touch" },
      // { value: "NO_TOUCH", label: "No Touch" },
      // { value: "CALL", label: "Call" },
      // { value: "PUT", label: "Put" },
      // { value: "UP", label: "Up" },
      // { value: "DOWN", label: "Down" },
    ],
    priority: 1,
    render: {
      type: "badge",
      config: {
        variant: (value) => {
          if (value === "RISE") {
            return "success";
          } else if (value === "FALL") {
            return "danger";
          }
          return "default";
        },
      },
    },
  },
  // {
  //   key: "type",
  //   title: "Type",
  //   type: "select",
  //   sortable: false,
  //   searchable: false,
  //   filterable: false,
  //   description: "Order type",
  //   options: [
  //     { value: "RISE_FALL", label: "Rise/Fall" },
  //     // { value: "HIGHER_LOWER", label: "Higher/Lower" },
  //     // { value: "TOUCH_NO_TOUCH", label: "Touch/No Touch" },
  //     // { value: "CALL_PUT", label: "Call/Put" },
  //     // { value: "TURBO", label: "Turbo" },
  //   ],
  //   priority: 1,
  // },
  {
    key: "status",
    title: "Status",
    type: "select",
    sortable: true,
    searchable: true,
    filterable: true,
    description: "Order status",
    options: [
      { value: "PENDING", label: "Pending" },
      { value: "WIN", label: "Win" },
      { value: "LOSS", label: "Loss" },
      { value: "DRAW", label: "Draw" },
      { value: "CANCELED", label: "Canceled" },
    ],
    priority: 1,
  },
  // {
  //   key: "durationType",
  //   title: "Duration Type",
  //   type: "select",
  //   icon: ClipboardList,
  //   sortable: true,
  //   searchable: true,
  //   filterable: true,
  //   description: "Duration measurement",
  //   options: [
  //     { value: "TIME", label: "Time" },
  //     { value: "TICKS", label: "Ticks" },
  //   ],
  //   priority: 2,
  //   expandedOnly: true,
  // },
  // {
  //   key: "barrier",
  //   title: "Barrier",
  //   type: "number",
  //   icon: DollarSign,
  //   sortable: true,
  //   searchable: false,
  //   filterable: true,
  //   description: "Barrier level",
  //   priority: 2,
  //   expandedOnly: true,
  // },
  // {
  //   key: "strikePrice",
  //   title: "Strike Price",
  //   type: "number",
  //   icon: DollarSign,
  //   sortable: true,
  //   searchable: false,
  //   filterable: true,
  //   description: "Strike price",
  //   priority: 2,
  //   expandedOnly: true,
  // },
  // {
  //   key: "payoutPerPoint",
  //   title: "Payout/Point",
  //   type: "number",
  //   icon: DollarSign,
  //   sortable: true,
  //   searchable: false,
  //   filterable: true,
  //   description: "Payout per point",
  //   priority: 2,
  //   expandedOnly: true,
  // },
  {
    key: "closePrice",
    title: "Close Price",
    type: "number",
    icon: DollarSign,
    sortable: true,
    searchable: false,
    filterable: true,
    description: "Closing price",
    priority: 2,
    expandedOnly: true,
  },
  {
    key: "createdAt",
    title: "Created At",
    type: "date",
    icon: CalendarIcon,
    sortable: true,
    searchable: true,
    filterable: true,
    description: "Order creation date",
    priority: 2,
    render: { type: "date", format: "PPP", fullDate: true },
  },
  {
    key: "closedAt",
    title: "Closed At",
    type: "date",
    icon: CalendarIcon,
    sortable: true,
    searchable: true,
    filterable: true,
    description: "Closing time",
    priority: 2,
    render: { type: "date", format: "PPP", fullDate: true },
  },
  {
    key: "isDemo",
    title: "Demo",
    type: "boolean",
    sortable: true,
    searchable: true,
    filterable: true,
    description: "Demo order flag",
    priority: 1,
    expandedOnly: true,
  },
];
