import { useState, useEffect } from "react"; import { FormControl, HStack, FormLabel, Tooltip, Box, Text, Input, InputGroup, InputRightElement, Button, } from "@chakra-ui/react"; import { InfoIcon, DeleteIcon } from "@chakra-ui/icons"; interface URIInputParams { uri: string; setUri: (value: string) => void; isConnected: boolean; initWalletConnect: () => void; } function URIInput({ uri, setUri, isConnected, initWalletConnect, }: URIInputParams) { const [pasted, setPasted] = useState(false); useEffect(() => { if (pasted) { initWalletConnect(); setPasted(false); } }, [uri]); return ( WalletConnect URI Visit any dApp and select WalletConnect. Click "Copy to Clipboard" beneath the QR code, and paste it here. } hasArrow placement="top" > setUri(e.target.value)} onPaste={(e) => { e.preventDefault(); setPasted(true); setUri(e.clipboardData.getData("text")); }} isDisabled={isConnected} /> {uri && !isConnected && ( )} ); } export default URIInput;