import { useAuth } from 'mystique/hooks/useAuth';

export const useActiveRetailer = () => {
  const auth = useAuth();

  return auth.loggedIn && auth.context.level === 'retailer'
    ? auth.context.current.contextId
    : auth.user.primaryRetailer?.id;
};