import { MRT_ColumnDef } from "material-react-table";

export const quotesData: MRT_ColumnDef<any>[] = [
  {
    accessorKey: "quote",
    header: "Quote#",
    size: 100,
    muiTableHeadCellProps: {
      sx: { color: "#3180F3", background: "#e0ecfe", fontSize: "12px" },
    },
  },

  {
    accessorKey: "RequestDate",
    header: "Request Date",
    size: 130,
    muiTableHeadCellProps: {
      sx: { color: "#3180F3", background: "#e0ecfe", fontSize: "12px" },
    },
  },
  {
    accessorKey: "Type",
    header: "Type",
    size: 100,
    muiTableHeadCellProps: {
      sx: { color: "#3180F3", background: "#e0ecfe", fontSize: "12px" },
    },
  },
  {
    accessorKey: "Size",
    header: "Size",
    size: 80,
    muiTableHeadCellProps: {
      sx: { color: "#3180F3", background: "#e0ecfe", fontSize: "12px" },
    },
  },
  {
    accessorKey: "Equipment",
    header: "Equipment",
    size: 120,
    muiTableHeadCellProps: {
      sx: { color: "#3180F3", background: "#e0ecfe", fontSize: "12px" },
    },
  },
  {
    accessorKey: "Port",
    header: "Port/Ramp",
    size: 150,
    muiTableHeadCellProps: {
      sx: { color: "#3180F3", background: "#e0ecfe", fontSize: "12px" },
    },
  },
  {
    accessorKey: "Origin",
    header: "Origin/Destination",
    size: 200,
    muiTableHeadCellProps: {
      sx: { color: "#3180F3", background: "#e0ecfe", fontSize: "12px" },
    },
  },
  {
    accessorKey: "Linehaul",
    header: "Linehaul + FSC Total",
    size: 200,
    muiTableHeadCellProps: {
      sx: {
        color: "#3180F3",
        background: "#e0ecfe",
        width: "100px",
        fontSize: "12px",
      },
    },
    Cell: ({ row }: { row: any }) => {
      if (row?.original?.Linehaul === "$400.00") {
        return (
          <p
            className=""
            style={{
              color: "red",
              textAlign: "start",
            }}
          >
            {row?.original?.Linehaul}
          </p>
        );
      }
      if (row?.original?.Linehaul === "$1,210.00") {
        return (
          <p
            className=""
            style={{
              color: "green",
              textAlign: "start",
            }}
          >
            {row?.original?.Linehaul}
          </p>
        );
      }
      if (row?.original?.Linehaul === "$483.00") {
        return (
          <p
            className=""
            style={{
              color: "yellow",
              textAlign: "start",
            }}
          >
            {row?.original?.Linehaul}
          </p>
        );
      }
      if (!row?.original?.Linehaul) {
        return <>N/A</>;
      }
    },
  },
];
