import type { ColumnDef } from "@tanstack/react-table"; import { Checkbox } from "~/components/ui/checkbox"; import type { TopUpResponse } from "~/types/api/top-up"; import { CellAction } from "./cell-action"; 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 PERMINTAAN", cell: ({ row }) => { return {toLocaleDateTime(row.original.topup.created_at)}; }, }, { accessorKey: "topup.nama", header: "NAMA ANGGOTA", }, { 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: "topup.status", header: "STATUS", cell: ({ row }) => { return ( {row.original.topup.status} ); }, }, { id: "actions", header: "AKSI", cell: ({ row }) => , }, ];