import { AutoColumn, Text } from '@honeycomb-finance/core'; import { ExternalLink, getEtherscanLink, useChainId, useENS, useTranslation } from '@honeycomb-finance/shared'; import React, { useCallback } from 'react'; import { ContainerRow, Input, InputContainer, InputPanel, Wrapper } from './styleds'; export default function AddressInputPanel({ id, value, onChange, }: { id?: string; // the typed string value value: string; // triggers whenever the typed value changes onChange: (value: string) => void; }) { const chainId = useChainId(); const { t } = useTranslation(); const { address, loading, name } = useENS(value); const handleInput = useCallback( (event) => { const input = event.target.value; const withoutSpaces = input.replace(/\s+/g, ''); onChange(withoutSpaces); }, [onChange], ); const error = Boolean(value.length > 0 && !loading && !address); return ( {t('addressInputPanel.recipient')} {address && chainId && ( {t('addressInputPanel.viewExplorer')} )} ); }