import React from 'react'; import PropTypes from 'prop-types'; import withModalProps from '../../../helpers/higher-order-components/with-modal-props'; import { useI18nContext } from '../../../hooks/useI18nContext'; import Modal from '../../app/modal'; import Box from '../../ui/box/box'; import { AlignItems, BorderRadius, DISPLAY, FLEX_DIRECTION, FONT_WEIGHT, TEXT_ALIGN, TextVariant, } from '../../../helpers/constants/design-system'; import { Text, Icon, IconName, IconSize } 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(TransactionFailedModal);