import React from 'react'; import { useSelector } from 'react-redux'; import PropTypes from 'prop-types'; import { getMetaMaskIdentities, getAccountName } from '../../../../selectors'; import Address from '../../transaction-decoding/components/decoding/address'; import { isValidHexAddress, toChecksumHexAddress, } from '../../../../../shared/modules/hexstring-utils'; import Box from '../../../ui/box'; import Typography from '../../../ui/typography'; import { DISPLAY, COLORS, FONT_WEIGHT, TYPOGRAPHY, } from '../../../../helpers/constants/design-system'; export default function SignatureRequestData({ data }) { const identities = useSelector(getMetaMaskIdentities); return ( {Object.entries(data).map(([label, value], i) => ( {label.charAt(0).toUpperCase() + label.slice(1)}:{' '} {typeof value === 'object' && value !== null ? ( ) : ( {isValidHexAddress(value, { mixedCaseUseChecksum: true, }) ? (
) : ( `${value}` )} )} ))} ); } SignatureRequestData.propTypes = { data: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired, };