import { useRef, useState } from "react"; import { ChevronDownIcon } from "@heroicons/react/solid"; import classNames from "classnames"; import { useClickAway } from "react-use"; export const DownloadButton = ({ onSave, }: { onSave: (e?: boolean) => void; }) => { const [dropdown, setDropdown] = useState(false); const ref = useRef(null); useClickAway(ref, () => { setDropdown(false); }); return (
{ e.preventDefault(); e.stopPropagation(); setDropdown(!dropdown); }} >
); };