import React, { useState } from 'react' import { styled } from '@linaria/react' const StyledButton = styled.button` display: flex; justify-content: center; align-items: center; flex-direction: row; svg > path { fill: var(--fg); } svg { margin-left: 0.5rem; } ` export const CopyAddressButton = ({ address }: { address: string }) => { const [copied, set] = useState(false) return ( { navigator.clipboard.writeText(address).then(() => set(true)) }} > {copied ? 'Copied' : 'Copy address'}{' '} ) }