import { Button, ButtonProps, HStack, Icon, StackProps } from '@chakra-ui/react' import { useState } from 'react' import { useTranslation } from 'react-i18next' import { PiCopy, PiLightning } from 'react-icons/pi' import { GEYSER_DOMAIN_POSTFIX } from '@/shared/constants/platform/domain' import { Body } from '../../../../../../../../../shared/components/typography' import { copyTextToClipboard } from '../../../../../../../../../utils' interface ILightningQR extends ButtonProps { name: string isGeyser?: boolean containerProps?: StackProps } export const LightningAddress = ({ name, isGeyser = true, containerProps, ...rest }: ILightningQR) => { const { t } = useTranslation() const [copy, setCopy] = useState(false) const handleAddressCopy = () => { let toCopy = name if (isGeyser) { toCopy += GEYSER_DOMAIN_POSTFIX } copyTextToClipboard(toCopy) setCopy(true) setTimeout(() => { setCopy(false) }, 2000) } return ( ) }