import React, { type PropsWithChildren } from "react"; import {MdClose} from "react-icons/md"; import AriaModal from "react-aria-modal"; import classnames from "classnames"; import { type WithTranslation, withTranslation } from "react-i18next"; type ModalInternalProps = PropsWithChildren & { "data-wd-key"?: string isOpen: boolean title: string onOpenToggle(): void underlayClickExits?: boolean className?: string } & WithTranslation; class ModalInternal extends React.Component { static defaultProps = { underlayClickExits: true }; // See onClose = () => { if (document.activeElement) { (document.activeElement as HTMLElement).blur(); } setTimeout(() => { this.props.onOpenToggle(); }, 0); }; render() { const t = this.props.t; if(this.props.isOpen) { return

{this.props.title}

{this.props.children}
; } else { return false; } } } const Modal = withTranslation()(ModalInternal); export default Modal;