/* eslint-disable no-negated-condition */
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { TRANSACTION_TYPES } from '../../../../../../shared/constants/transaction';
import { toChecksumHexAddress } from '../../../../../../shared/modules/hexstring-utils';
import { useI18nContext } from '../../../../../hooks/useI18nContext';
import useAddressDetails from '../../../../../hooks/useAddressDetails';
import Identicon from '../../../../ui/identicon';
import InfoTooltip from '../../../../ui/info-tooltip';
import NicknamePopovers from '../../../modals/nickname-popovers';
const ConfirmPageContainerSummary = (props) => {
const {
action,
title,
titleComponent,
subtitleComponent,
hideSubtitle,
className,
identiconAddress,
nonce,
origin,
hideTitle,
image,
transactionType,
toAddress,
} = props;
const [showNicknamePopovers, setShowNicknamePopovers] = useState(false);
const t = useI18nContext();
const { toName, isTrusted } = useAddressDetails(toAddress);
const isContractTypeTransaction =
transactionType === TRANSACTION_TYPES.CONTRACT_INTERACTION;
const checksummedAddress = toChecksumHexAddress(toAddress);
const renderImage = () => {
if (image) {
return (
);
} else if (identiconAddress) {
return (