import { useContext } from 'react' import { Chain } from 'types' import { Web3Context } from '@/providers/Web3Provider' import { ConnectedIndicator } from '@/components/icons/ConnectedIndicator' export const ChainOption = ({ option, isSelected, onSelect, isOrigin, }: { option: Chain isSelected: boolean onSelect: (option: Chain) => void isOrigin?: boolean }) => { const web3Context = useContext(Web3Context) const { web3Provider } = web3Context || {} const networkId = web3Provider?.networkId const connectedAddress = web3Provider?.connectedAddress return (
  • onSelect(option)} >
    {option?.imgUrl && ( {`${option?.name} )} {option?.name}
    {isOrigin && (option.id === networkId ? ( ) : connectedAddress ? ( Switch ) : null)}
  • ) }