
import { useCallback } from 'react';
import { Transaction } from '@/components/TransactionCard';
import { useBudget } from '@/contexts/BudgetContext';

export const useTransactionsOperations = (transactions: Transaction[]) => {
  const { deleteTransaction: budgetDeleteTransaction } = useBudget();

  const deleteTransaction = useCallback(async (id: string): Promise<boolean> => {
    try {
      budgetDeleteTransaction(id);
      return true;
    } catch (error) {
      console.error('트랜잭션 삭제 중 오류:', error);
      return false;
    }
  }, [budgetDeleteTransaction]);

  return {
    deleteTransaction
  };
};
