import * as React from 'react'; import styles from './Modal.module.scss'; import { IconButton } from './IconButton'; import { texts } from '../../texts'; export interface IModalProps { title: string; onClose: () => void; footer?: React.ReactNode; children: React.ReactNode; } export const Modal: React.FC = ({ title, onClose, footer, children }) => ( // Клик по подложке закрывает окно, клик внутри — нет (проверяем сам currentTarget).
{ if (e.target === e.currentTarget) onClose(); }}>
{title}
{children}
{footer &&
{footer}
}
);