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

const useManageWalletRuleContext = () => {
  const context = useContext(ManageWalletRuleContext);

  if (!context) {
    throw new Error(
      'useManageWalletRuleContext must be used within a ManageWalletRuleContextProvider'
    );
  }

  return context;
};

export { useManageWalletRuleContext };
