"use client"; import { useState, useCallback } from "react"; import { QRCodeSVG } from "qrcode.react"; export function ShareProfileButton({ userId, shareUrl }: { userId: string; shareUrl: string }) { const [open, setOpen] = useState(false); const [copied, setCopied] = useState(false); const handleCopy = useCallback(() => { navigator.clipboard.writeText(shareUrl).then(() => { setCopied(true); setTimeout(() => setCopied(false), 2000); }); }, [shareUrl]); return ( <> {open && ( <> {/* Backdrop */}
Scan this QR code or share the link to add you as a friend.
{/* QR Code */}User ID: {userId}