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 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: "user.nik", header: "NIK", }, { accessorKey: "topup.nama", header: "NAMA Lengkap", }, { accessorKey: "topup.nominal", header: "NOMINAL", cell: ({ row }) => { return (
{toRupiah(row.original.topup.nominal)} {row.original.topup.nama_bank}
); }, }, { accessorKey: "topup.jenis", header: "JENIS TRANSAKSI", }, { accessorKey: "status", header: "STATUS", cell: ({ row }) => { return ( {row.original.topup.status} ); }, }, ];