import type { ColumnDef } from "@tanstack/react-table"; import { Checkbox } from "~/components/ui/checkbox"; import type { TMutasi } from "~/types/api/laporan"; import { toLocaleDateTime } from "~/utils/format-to-locale-time"; import { formatImagePath } from "~/utils/prefix-file-path"; 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: "created_at", header: "TANGGAL", cell: ({ row }) => { return (
{toLocaleDateTime(row.original.created_at)}
); }, }, { accessorKey: "judul", header: "JUDUL LAPORAN", }, { accessorKey: "pemasukan", header: "PEMASUKAN", cell: ({ row }) => { return (
{toRupiah(row.original.pemasukan)}
); }, }, { accessorKey: "pengeluaran", header: "PENGELUARAN", cell: ({ row }) => { return (
{toRupiah(row.original.pengeluaran)}
); }, }, { accessorKey: "laporan", header: "DOKUMEN LAPORAN", cell: ({ row }) => { return (
Lihat Dokumen
); }, }, ];