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