import React from 'react'; import PropTypes from 'prop-types'; import Identicon from '../../ui/identicon'; import AccountMismatchWarning from '../../ui/account-mismatch-warning/account-mismatch-warning.component'; import { toChecksumHexAddress } from '../../../../shared/modules/hexstring-utils'; export default function AccountListItem({ account, className, displayAddress = false, handleClick, icon = null, }) { const { name, address, balance } = account || {}; return (
handleClick?.({ name, address, balance })} >
{name || address}
{icon &&
{icon}
}
{displayAddress && name && (
{toChecksumHexAddress(address)}
)}
); } AccountListItem.propTypes = { account: PropTypes.object, className: PropTypes.string, displayAddress: PropTypes.bool, handleClick: PropTypes.func, icon: PropTypes.node, };