import { ColumnDef } from "@tanstack/react-table";
import { TransactionStatusBadge } from "../components/TransactionStatusBadge";
import Link from "next/link";
import { UserTransactionHistory } from "../../../../../hooks/features/admin/transactions/useUserTransactionsFetch";

export const userTransactionsHistoryColumns: ColumnDef<UserTransactionHistory>[] =
  [
    {
      accessorKey: "date",
      header: "Date",
      cell: ({ row }) => <span>{row.original.createdAt}</span>,
    },

    {
      accessorKey: "title",
      header: "Title",
      cell: ({ row }) => <span>{row.original.title}</span>,
    },

    {
      accessorKey: "amount",
      header: "Amount",
      cell: ({ row }) => <span>${row.original.amount}</span>,
    },

    {
      accessorKey: "credits",
      header: "Credits",
      cell: ({ row }) => <span>{row.original.credits}</span>,
    },

    {
      accessorKey: "status",
      header: "Status",
      cell: ({ row }) => (
        <TransactionStatusBadge status={row.original.status} />
      ),
    },
  ];
