import type { ColumnDef } from "@tanstack/react-table"; import { Checkbox } from "~/components/ui/checkbox"; import type { TopUpResponse } from "~/types/api/top-up"; import { TOPUP_STATUS } from "~/types/constants/status-top-up"; import { toLocaleDateTime } from "~/utils/format-to-locale-time"; import toRupiah from "~/utils/to-rupiah"; export const columns: ColumnDef[] = [ { id: "select", header: ({ table }) => ( table.toggleAllPageRowsSelected(!!value)} /> ), cell: ({ row }) => ( row.toggleSelected(!!value)} /> ), enableSorting: false, enableHiding: false, }, { accessorKey: "topup.created_at", header: "TANGGAL TRANSAKSI", cell: ({ row }) => { return {toLocaleDateTime(row.original.topup.created_at)}; }, }, { accessorKey: "topup.nominal", header: "NOMINAL", cell: ({ row }) => { return (
{toRupiah(row.original.topup.nominal)} {row.original.topup.nama_bank}
); }, }, { accessorKey: "topup.jenis", header: "JENIS TRANSAKSI", cell: ({ row }) => { return {row.original.topup.jenis}; }, }, { accessorKey: "topup.status", header: "STATUS", cell: ({ row }) => { return ( {row.original.topup.status} ); }, }, ];