import type { ColumnDef } from "@tanstack/react-table"; import { Checkbox } from "~/components/ui/checkbox"; import type { TLaporanResponse } from "~/types/api/laporan"; 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: "tanggal", header: "TANGGAL", cell: ({ row }) => { return (
{toLocaleDateTime(row.original.created_at)}
); }, }, { accessorKey: "judul", header: "JUDUL LAPORAN", }, { accessorKey: "jenis_laporan", header: "JENIS LAPORAN", }, { accessorKey: "modal", header: "MODAL", cell: ({ row }) => { return (
{toRupiah(row.original.modal)}
); }, }, { accessorKey: "nominal", header: "NOMINAL", cell: ({ row }) => { return (
{toRupiah(row.original.nominal)}
); }, }, ];