Refactor Transactions page

Refactors the Transactions page into smaller, more manageable components to improve code organization and maintainability. The functionality remains the same.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-17 23:24:12 +00:00
parent dea8b9f8ba
commit f1f9227abf
7 changed files with 296 additions and 126 deletions

View File

@@ -0,0 +1,37 @@
import React from 'react';
import TransactionCard, { Transaction } from '@/components/TransactionCard';
interface TransactionDateGroupProps {
date: string;
transactions: Transaction[];
onTransactionDelete: (id: string) => void;
}
const TransactionDateGroup: React.FC<TransactionDateGroupProps> = ({
date,
transactions,
onTransactionDelete
}) => {
return (
<div>
<div className="flex items-center gap-2 mb-3">
<div className="h-1 flex-1 neuro-pressed"></div>
<h2 className="text-sm font-medium text-gray-500">{date}</h2>
<div className="h-1 flex-1 neuro-pressed"></div>
</div>
<div className="grid gap-3">
{transactions.map(transaction => (
<TransactionCard
key={transaction.id}
transaction={transaction}
onDelete={onTransactionDelete}
/>
))}
</div>
</div>
);
};
export default TransactionDateGroup;