import { Text, Box, Divider, Flex, Heading, useToast, Button, Grid, Image, } from "@chakra-ui/react"; import Qrcode from "qrcode"; import { useEffect, useRef } from "react"; const QrView: React.FC<{ uri: string }> = ({ uri }) => { const canvasRef = useRef(null); const toast = useToast(); useEffect(() => { if (uri && canvasRef.current) Qrcode.toCanvas(canvasRef.current, uri); }, [uri, canvasRef]); const onClick = async () => { await navigator.clipboard.writeText(uri); toast({ title: "Copied URI", }); }; return ( scan Scan with your phone Open your camera app or mobile wallet and scan the code to connect ); }; export default QrView;