import useOutsideClick from "./useOutsideClick.js";

export default function useAppOutsideClicks({
  notificationsOpen,
  notificationsModalRef,
  bellRef,
  setNotificationsOpen,
  moreActionsOpen,
  moreActionsRef,
  setMoreActionsOpen
}) {
  useOutsideClick({
    enabled: notificationsOpen,
    refs: [notificationsModalRef, bellRef],
    onOutside: () => setNotificationsOpen(false)
  });
  useOutsideClick({
    enabled: moreActionsOpen,
    refs: [moreActionsRef],
    onOutside: () => setMoreActionsOpen(false)
  });
}
