import './menu-picker.scss'; import React, { useRef, useState } from "react"; import { cssNames } from "../../utils"; import { Menu, MenuProps } from "./menu"; import { Icon } from "../icon"; import { Button } from "../button"; import uniqueId from "lodash/uniqueId"; interface Props extends Partial { title: React.ReactNode; waiting?: boolean; } export function MenuPicker(props: Props): JSX.Element { const id = useRef(uniqueId("menu_picker_")).current; const { className, title, waiting, children, ...menuProps } = props; const [isOpen, setOpen] = useState(false); const toggle = (): void => setOpen(!isOpen); return (
{title}
{children}
); }