import Image from 'next/image' import { TOKEN_HASH_MAP, AVWETH, USDC } from '@synapsecns/synapse-constants' import { getTokenAddressUrl } from '@urls' export const AssetImage = ({ tokenAddress, chainId, className }) => { tokenAddress = tokenAddress if (hasRequiredData({ tokenAddress, chainId })) { const t = chainId && tokenAddress && TOKEN_HASH_MAP[chainId]?.[tokenAddress] return (
) } if ( chainId === 43114 && tokenAddress === '0x53f7c5869a859F0AeC3D334ee8B4Cf01E3492f21' ) { const t = AVWETH return ( ) } else { return ( // temporary fix until either symbolToToken works better as a function or explorer indexer has the right token addresses // ) } } const hasRequiredData = ({ tokenAddress, chainId }) => { return ( tokenAddress && chainId && TOKEN_HASH_MAP[chainId] && TOKEN_HASH_MAP[chainId][tokenAddress] ) }