"use client" import { Eye, Pencil, Trash2 } from "lucide-react" import { Badge } from "@/components/ui/badge" import { DataTable, type DataTableColumn } from "@/components/ui/data-table" const orders = [ { id: "#3210", customer: "John Martinez", date: "Jul 4, 2026", status: "Paid", items: 3, amount: 245.0 }, { id: "#3209", customer: "Aisha Khan", date: "Jul 3, 2026", status: "Pending", items: 1, amount: 89.5 }, { id: "#3208", customer: "Liam Chen", date: "Jul 3, 2026", status: "Paid", items: 5, amount: 512.2 }, { id: "#3207", customer: "Sofia Rossi", date: "Jul 2, 2026", status: "Cancelled", items: 2, amount: 64.0 }, { id: "#3206", customer: "Noah Williams", date: "Jul 1, 2026", status: "Paid", items: 4, amount: 178.9 }, { id: "#3205", customer: "Emma Garcia", date: "Jun 30, 2026", status: "Paid", items: 2, amount: 132.4 }, { id: "#3204", customer: "Yuki Tanaka", date: "Jun 30, 2026", status: "Pending", items: 6, amount: 340.75 }, { id: "#3203", customer: "Priya Patel", date: "Jun 29, 2026", status: "Paid", items: 1, amount: 42.0 }, { id: "#3202", customer: "Lucas Silva", date: "Jun 28, 2026", status: "Cancelled", items: 3, amount: 97.6 }, { id: "#3201", customer: "Olivia Brown", date: "Jun 27, 2026", status: "Paid", items: 4, amount: 210.3 }, { id: "#3200", customer: "Mateo Alvarez", date: "Jun 26, 2026", status: "Paid", items: 2, amount: 88.0 }, { id: "#3199", customer: "Grace Kim", date: "Jun 25, 2026", status: "Pending", items: 5, amount: 265.5 }, ] as const type Order = (typeof orders)[number] const statusStyles: Record = { Paid: "bg-emerald-50 text-emerald-700", Pending: "bg-amber-50 text-amber-700", Cancelled: "bg-rose-50 text-rose-700", } const currency = new Intl.NumberFormat(undefined, { style: "currency", currency: "USD", }) const columns: DataTableColumn[] = [ { key: "id", header: "Order", cell: (order) => {order.id}, }, { key: "customer", header: "Customer", cell: (order) => order.customer, }, { key: "date", header: "Date", cell: (order) => order.date, headerClassName: "hidden sm:table-cell", cellClassName: "hidden text-muted-foreground sm:table-cell", }, { key: "items", header: "Items", cell: (order) => order.items, headerClassName: "hidden md:table-cell", cellClassName: "hidden text-muted-foreground md:table-cell", }, { key: "status", header: "Status", cell: (order) => {order.status}, }, { key: "amount", header: "Amount", cell: (order) => currency.format(order.amount), headerClassName: "text-right", cellClassName: "text-right font-medium text-slate-900", }, ] export function RecentOrdersTable() { return (

Recent Orders

order.id} searchAccessor={(order) => `${order.id} ${order.customer}`} searchPlaceholder="Search orders..." filters={[ { key: "status", label: "Status", options: ["Paid", "Pending", "Cancelled"], accessor: (order) => order.status, }, ]} pageSize={5} actions={(order) => (
)} />
) }