import { useContext } from 'react';
import { CreditAddContext } from './CreditAddContext';

const useCreditAddContext = () => {
  const context = useContext(CreditAddContext);

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

  return context;
};

export { useCreditAddContext };
