'use client';

import * as React from 'react';
export function useMenuPopup(parameters) {
  const {
    menuEvents,
    setOpen
  } = parameters;
  React.useEffect(() => {
    function handleClose(event) {
      setOpen(false, event);
    }
    menuEvents.on('close', handleClose);
    return () => {
      menuEvents.off('close', handleClose);
    };
  }, [menuEvents, setOpen]);
}