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

const useManageProductsContext = () => {
  const context = useContext(ManageProductsContext);
  if (!context) {
    throw new Error('useManageProductsContext must be used within a ManageProductsContextProvider');
  }
  return context;
};

export { useManageProductsContext };
