import React, { useRef } from 'react'; import { FormattedMessage } from 'react-intl'; import { Button, HStack, Input } from './ui'; interface ICopyableInput { /** Text to be copied. */ value: string, } /** An input with copy abilities. */ const CopyableInput: React.FC = ({ value }) => { const input = useRef(null); const selectInput = () => { input.current?.select(); if (navigator.clipboard) { navigator.clipboard.writeText(value); } else { document.execCommand('copy'); } }; return ( ); }; export default CopyableInput;