
import React from 'react';
import TransactionCard, { Transaction } from '@/components/TransactionCard';
import TransactionDateGroup from './TransactionDateGroup';

interface TransactionsListProps {
  groupedTransactions: Record<string, Transaction[]>;
  onTransactionDelete: (id: string) => Promise<boolean> | boolean;
}

const TransactionsList: React.FC<TransactionsListProps> = ({
  groupedTransactions,
  onTransactionDelete
}) => {
  return (
    <div className="space-y-6 mb-[50px]">
      {Object.entries(groupedTransactions).map(([date, dateTransactions]) => (
        <TransactionDateGroup 
          key={date} 
          date={date} 
          transactions={dateTransactions}
          onTransactionDelete={onTransactionDelete}
        />
      ))}
    </div>
  );
};

export default TransactionsList;
