import { Spin, Modal as AntModal } from 'antd'; import React, { FC, ReactNode, useState } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import { ComponentError } from '../ComponentError/ComponentError'; import styles from './Modal.module.scss'; export type ModalProps = { title: string; url?: string; open: boolean; handleOk?: () => void; handleCancel?: () => void; afterClose?: () => void; children?: ReactNode; height?: string; width?: string; }; export const Modal: FC = ({ title, url, open, handleOk, handleCancel, afterClose, height, width, children, }) => { const [loading, setLoading] = useState(!!url); let defaultHeight = '100%'; let defaultWidth = '520px'; if (url) { defaultHeight = '70vh'; defaultWidth = '900px'; } const modalContentBodyStyle = { padding: '0px', minHeight: height, height: height ?? defaultHeight, }; const iframe = url && (