import "./Modal.scss"; import React, { useEffect, useState } from "react"; import { createPortal } from "react-dom"; import { KEYS } from "../keys"; export function Modal(props: { className?: string; children: React.ReactNode; maxWidth?: number; onCloseRequest(): void; labelledBy: string; }) { const modalRoot = useBodyRoot(); const handleKeydown = (event: React.KeyboardEvent) => { if (event.key === KEYS.ESCAPE) { event.nativeEvent.stopImmediatePropagation(); props.onCloseRequest(); } }; return createPortal(