import type { ColumnDef } from "@tanstack/react-table"; import { Checkbox } from "~/components/ui/checkbox"; import { CellAction } from "./cell-action"; import type { ProyekPendanaan } from "~/types/api/proyek-pendanaan"; import toRupiah from "~/utils/to-rupiah"; import { Badge } from "~/components/ui/badge"; import { StatusProject } from "~/types/constants/status-project"; export const columns: ColumnDef[] = [ { id: "select", header: ({ table }) => ( table.toggleAllPageRowsSelected(!!value)} /> ), cell: ({ row }) => ( row.toggleSelected(!!value)} /> ), enableSorting: false, enableHiding: false, }, { accessorKey: "user.nama", header: "PEMILIK PROYEK", cell: ({ row }) => { return ( {row.original.user ? row.original.user.nama : "Unknown User"} ); }, }, { accessorKey: "project.judul", header: "NAMA PROYEK", }, { accessorKey: "dana_terkumpul", header: "DANA TERKUMPUL", cell: ({ row }) => { return (
{toRupiah(row.original.dana_terkumpul)}
); }, }, { accessorKey: "saldo", header: "DANA TERSISA", cell: ({ row }) => { return (
{toRupiah(row.original.saldo)}
); }, }, { accessorKey: "project.status", header: "STATUS", cell: ({ row }) => { return ( {row.original.project?.status} ); }, }, { id: "actions", header: "AKSI", cell: ({ row }) => , }, ];