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:
37
src/components/transactions/TransactionDateGroup.tsx
Normal file
37
src/components/transactions/TransactionDateGroup.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user