import React from "react"; import Address from "./Address"; import AddressLink from "./AddressLink"; import ENSName from "./ENSName"; import ENSNameLink from "./ENSNameLink"; import { ResolvedAddresses } from "../api/address-resolver"; type AddressOrENSNameProps = { address: string; selectedAddress?: string; text?: string; dontOverrideColors?: boolean; resolvedAddresses?: ResolvedAddresses | undefined; }; const AddressOrENSName: React.FC = ({ address, selectedAddress, text, dontOverrideColors, resolvedAddresses, }) => { const name = resolvedAddresses?.[address]; return ( <> {address === selectedAddress ? ( <> {name ? ( ) : (
)} ) : ( <> {name ? ( ) : ( )} )} ); }; export default React.memo(AddressOrENSName);