import React, { memo } from 'react'; import PropTypes from 'prop-types'; import withModalProps from '../../../helpers/higher-order-components/with-modal-props'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { AlignItems, BorderRadius, Display, FlexDirection, TextAlign, TextVariant, } from '../../../helpers/constants/design-system'; import { Icon, IconName, IconSize, Text, Box, Modal, ModalContent, ModalHeader, ModalOverlay, Button, BUTTON_VARIANT, BUTTON_SIZES, } from '../../component-library'; const TransactionFailedModal = ({ hideModal, closeNotification, operationFailed, errorMessage, }) => { const t = useI18nContext(); const handleSubmit = () => { if (closeNotification) { global.platform.closeCurrentWindow(); } hideModal(); }; return ( {operationFailed ? `${t('operationFailed')}!` : `${t('transactionFailed')}!`} {errorMessage} ); }; TransactionFailedModal.propTypes = { hideModal: PropTypes.func, errorMessage: PropTypes.string, closeNotification: PropTypes.bool, operationFailed: PropTypes.bool, }; export default withModalProps(memo(TransactionFailedModal));