import React, { FC, memo } from '../../lib/teact/teact'; import useLang from '../../hooks/useLang'; import { TextPart } from '../common/helpers/renderMessageText'; import Modal from './Modal'; import Button from './Button'; type OwnProps = { isOpen: boolean; onClose: () => void; onCloseAnimationEnd?: () => void; header?: FC; textParts?: TextPart[]; text?: string; confirmLabel?: string; confirmHandler: () => void; confirmIsDestructive?: boolean; isButtonsInOneRow?: boolean; }; const ConfirmDialog: FC = ({ isOpen, onClose, onCloseAnimationEnd, header, text, textParts, confirmLabel = 'Confirm', confirmHandler, confirmIsDestructive, isButtonsInOneRow, }) => { const lang = useLang(); return ( {text && text.split('\\n').map((textPart) => (

{textPart}

))} {textParts}
); }; export default memo(ConfirmDialog);