import Link from 'next/link' import Image from 'next/image' import { QuestionMarkCircleIcon } from '@heroicons/react/outline' import { CHAINS } from '@synapsecns/synapse-constants' import { getChainUrl, getExplorerTxUrl } from '@urls' const CHAINS_BY_ID = CHAINS.CHAINS_BY_ID interface ChainInfoProps { chainId?: any imgClassName?: string linkClassName?: string textClassName?: string txHash?: string useExplorerLink?: boolean noLink?: boolean className?: string } export const ChainInfo = ({ chainId, imgClassName = 'w-4 h-4 rounded-full', textClassName = 'pl-1 whitespace-nowrap text-sm text-white', txHash, useExplorerLink = false, className = '', }: ChainInfoProps) => { const chain = CHAINS_BY_ID[chainId] let link = '' if (txHash) { link = getExplorerTxUrl({ hash: txHash, chainId }) } if (useExplorerLink) { link = getChainUrl({ chainId }) } if (chain) { return (
{chain?.name}

{chain.name}

) } else { return (
--
) } }