"use client"; import { ColumnDef } from "@tanstack/react-table"; import { Ghost, MoreHorizontal } from "lucide-react"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; export type Customer = { id: string; name: string; occupation: string; phone: string; address: string; balance: number; }; export const columns: ColumnDef[] = [ { accessorKey: "id", header: "ID", size: 70, }, { accessorKey: "name", header: "Name", }, { accessorKey: "occupation", header: "Occupation", }, { accessorKey: "phone", header: "Phone", }, { accessorKey: "address", header: "Address", size: 150, }, { accessorKey: "balance", header: () =>
Balance
, cell: ({ row }) => { const amount = parseFloat(row.getValue("balance")); const formatted = new Intl.NumberFormat("en-IN", { style: "currency", currency: "INR", minimumFractionDigits: 2, maximumFractionDigits: 2, }).format(amount); return
{formatted}
; }, }, { id: "actions", header: () =>
More Actions
, cell: ({ row }) => { const customer = row.original; return (
Actions navigator.clipboard.writeText(customer.id)} > Copy Customer ID View Transactions Edit Customer Delete Customer
); }, }, ];