import { Modal } from 'antd'; import { FC } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import styles from './ChatModal.module.scss'; import { ComponentError } from '../../ui/ComponentError/ComponentError'; import { ChatContainer } from '../../chat/ChatContainer/ChatContainer'; import { ChatMessage } from '../../../interfaces/chat-message.model'; import { CurrentUser } from '../../../interfaces/current-user'; import { UserDropdown } from '../../common/UserDropdown/UserDropdown'; export type ChatModalProps = { messages: ChatMessage[]; currentUser: CurrentUser; handleClose: () => void; }; export const ChatModal: FC = ({ messages, currentUser, handleClose }) => { if (!currentUser) { return null; } const { id, displayName, isModerator } = currentUser; const modalBodyStyle = { padding: '0px', height: '55vh', }; return ( ( )} > } maskStyle={{ zIndex: 700, }} className={styles.root} bodyStyle={modalBodyStyle} wrapClassName={styles.modalWrapper} onCancel={handleClose} > ); };