--- import { formatCurrency, formatDate } from '../utils'; import type { Transaction } from '../types'; interface Props { transactions: Transaction[]; } const { transactions } = Astro.props; // Sort transactions by date descending for display const sortedTransactions = [...transactions].sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime()); ---
{sortedTransactions.map(txn => ( ))} {sortedTransactions.length === 0 && ( )}
Date Description Amount Actions
{formatDate(txn.date)} {txn.description} = 0 ? 'amount-positive' : 'amount-negative'}`}> {formatCurrency(txn.amount)}
No transactions found for this account.