import { Button } from '@/ui/Button'; import { Grid } from '@/ui/Grid'; import { Icon } from '@/ui/Icon'; import { Stack } from '@/ui/Stack'; import { Text } from '@/ui/Text'; import { AlertTriangle, Check, Clock, Download, Receipt } from 'lucide-react'; export interface Transaction { id: string; formattedDate: string; description: string; formattedAmount: string; status: 'paid' | 'pending' | 'overdue' | 'failed'; invoiceNumber: string; type: string; } interface TransactionTableProps { transactions: Transaction[]; onDownload?: (id: string) => void; } const STATUS_CONFIG = { paid: { icon: Check, label: 'Paid', color: 'text-performance-green', bg: 'bg-performance-green/10', border: 'border-performance-green/30' }, pending: { icon: Clock, label: 'Pending', color: 'text-warning-amber', bg: 'bg-warning-amber/10', border: 'border-warning-amber/30' }, overdue: { icon: AlertTriangle, label: 'Overdue', color: 'text-racing-red', bg: 'bg-racing-red/10', border: 'border-racing-red/30' }, failed: { icon: AlertTriangle, label: 'Failed', color: 'text-racing-red', bg: 'bg-racing-red/10', border: 'border-racing-red/30' }, }; /** * TransactionTable * * A semantic table for displaying financial transactions. * Dense layout with thin dividers, optimized for ops panels. */ export function TransactionTable({ transactions, onDownload }: TransactionTableProps) { return ( Description Date Amount Status Action {transactions.map((tx, index) => { const status = STATUS_CONFIG[tx.status]; return ( {tx.description} {tx.invoiceNumber} • {tx.type} {tx.formattedDate} {tx.formattedAmount} {status.label} ); })} ); }