import { useRef, useState } from "react"; import { useClickAway } from "react-use"; import classNames from "classnames"; import { ChevronDownIcon } from "@heroicons/react/solid"; import { FONT_FAMILY } from "./font-family.constants"; export const FontFamilySelector = ({ value, onSelect, }: { value?: any; onSelect: (t: string) => void; }) => { const [open, setOpen] = useState(false); const ref = useRef(null); const selected = FONT_FAMILY.find((f) => f.label === value); useClickAway(ref, () => setOpen(false)); return (