import { Transaction } from '@/data/mockData'; import { Bike, Banknote, Send, CreditCard, TrendingUp, ArrowUpDown } from 'lucide-react'; import { LucideIcon } from 'lucide-react'; interface TransactionListProps { transactions: Transaction[]; compact?: boolean; } const typeIcons: Record = { rental_payment: Bike, deposit: Banknote, withdrawal: Send, topup: CreditCard, earning: TrendingUp, refund: ArrowUpDown, }; const typeColors: Record = { rental_payment: 'text-blue-600', deposit: 'text-green-600', withdrawal: 'text-amber-600', topup: 'text-blue-600', earning: 'text-green-600', refund: 'text-purple-600', }; export default function TransactionList({ transactions, compact }: TransactionListProps) { if (compact) { return (
{transactions.slice(0, 5).map((tx) => { const Icon = typeIcons[tx.type] || Bike; return (

{tx.description}

{tx.createdAt}

{tx.type === 'withdrawal' ? '-' : '+'}৳{tx.amount.toLocaleString()}
); })}
); } return (

Recent Transactions

{transactions.map((tx) => { const Icon = typeIcons[tx.type] || Bike; return (

{tx.description}

{tx.createdAt}

{tx.type === 'withdrawal' ? '-' : '+'}৳{tx.amount.toLocaleString()}

{tx.status}
); })}
); }