/* eslint-disable no-negated-condition */ import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import Identicon from '../../../../ui/identicon'; const ConfirmPageContainerSummary = (props) => { const { action, title, titleComponent, subtitleComponent, hideSubtitle, className, identiconAddress, nonce, origin, hideTitle, image, } = props; const renderImage = () => { if (image) { return ( ); } else if (identiconAddress) { return ( ); } return null; }; return (
{origin === 'metamask' ? null : (
{origin}
)}
{action}
{nonce && (
{`#${nonce}`}
)}
<>
{renderImage()} {!hideTitle ? (
{titleComponent || title}
) : null}
{hideSubtitle ? null : (
{subtitleComponent}
)}
); }; ConfirmPageContainerSummary.propTypes = { action: PropTypes.string, title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), image: PropTypes.string, titleComponent: PropTypes.node, subtitleComponent: PropTypes.node, hideSubtitle: PropTypes.bool, className: PropTypes.string, identiconAddress: PropTypes.string, nonce: PropTypes.string, origin: PropTypes.string.isRequired, hideTitle: PropTypes.bool, }; export default ConfirmPageContainerSummary;