import { useContext } from 'react';
import { ManageTransactionContext } from './TransactionContext';

const useTransactionContext = () => {
  const context = useContext(ManageTransactionContext);

  if (!context) throw new Error('useTransactionContext must be used within AuthProvider');

  return context;
};

export { useTransactionContext };
