import React from 'react'; import { MoreVertical, ArrowDownRight, ArrowUpRight, ChevronLeft, ChevronRight } from 'lucide-react'; export default function AccountsTable({ data = [], pagination = null, onPageChange }) { const formatCurrency = (val) => { return new Intl.NumberFormat('en-AE', { style: 'currency', currency: 'AED' }).format(val); }; return (

Recent Transactions

Detailed breakdown of income and expenses.

{data.length === 0 && ( )} {data.map((row, index) => ( ))}
Date Type Category / Description Amount
No transactions found for the selected period.
{new Date(row.date).toLocaleDateString()} {new Date(row.date).toLocaleDateString(undefined, { weekday: 'short' })}
{row.type === 'Income' ? : } {row.type}
{row.category} {row.description || 'No description provided'}
{row.type === 'Income' ? '+' : '-'}{formatCurrency(row.amount)}
{/* Pagination Controls */} {pagination && pagination.last_page > 1 && (

Showing page {pagination.current_page} of {pagination.last_page} ({pagination.total} total)

{[...Array(pagination.last_page)].map((_, i) => ( ))}
)}
); }