import { Dispatch, SetStateAction } from "react"; import Button from "./Button"; export type PopupProps = { setState: | Dispatch> | Dispatch>; state?: boolean; children: React.ReactNode; fillViewport?: boolean; hideBackground?: boolean; }; export default function Popup(props: PopupProps): JSX.Element { return (
{ if (e.key.match("Escape")) props.setState(false); }} tabIndex={0} >
{ props.setState(false); }} />
{props.children}
); }