import { ClipboardClose, ClipboardTick } from "iconsax-react";
import { createColumns } from "../components/common/create-col";
import { colConfig } from "../types";
import { filterNumber } from "./status";



const columnConfigs: colConfig[] | [] = [
    {
        accessor: "status", header: "وضعیت",
        cellRenderer: (info) => info.getValue() === 1 ? <ClipboardTick color="#11212D" className="flex w-full" /> : <ClipboardClose color="#E51717" className="flex w-full" />
    },
    {
        accessor: "amount", header: "مبلغ",
        cellRenderer: (info) => info.getValue() && <div className="w-full justify-center flex flex-row gap-2 items-end">
            <p className="text-primary-text-color text-base font-normal">{filterNumber(info.getValue())}</p>
            <p className="text-primary-text-color font-normal text-xs">تومان</p>
        </div>
    },
    { accessor: "request_date", header: "تاریخ درخواست", cellRenderer: (info) => info.getValue() && <p style={{ direction: "ltr" }}>{info.getValue()}</p> },
    { accessor: "traking_number", header: "شماره پیگیری" },
    { accessor: "deposit_date", header: "تاریخ واریز" },
];

export const transactionsCol = createColumns<any>(columnConfigs);