import { jsx } from "react/jsx-runtime";
import React from "react";
import { Root as MenuRoot } from "@radix-ui/react-dropdown-menu";
import { bool, node } from "prop-types";
const Menu = ({ children, onMouseHover = true }) => {
  const [isOpen, setIsOpen] = React.useState(false);
  function handleOpenMenu() {
    setIsOpen(!isOpen);
  }
  if (!onMouseHover) {
    return /* @__PURE__ */ jsx(MenuRoot, { sideOffset: 5, modal: false, children });
  }
  return /* @__PURE__ */ jsx("div", { onMouseEnter: handleOpenMenu, onMouseLeave: handleOpenMenu, children: /* @__PURE__ */ jsx(MenuRoot, { sideOffset: 5, modal: false, defaultOpen: true, open: isOpen, children }) });
};
Menu.propTypes = {
  children: node.isRequired,
  /** when mouse hover menu open as default is true */
  onMouseHover: bool
};
Menu.displayName = "Menu";
var Menu_default = Menu;
export {
  Menu_default as default
};
