import { useEffect, useState } from 'react'; import QRCode from 'qrcode'; interface QrDisplayProps { value: string; } export const QrDisplay: React.FC = ({ value }) => { const [dataUrl, setDataUrl] = useState(''); useEffect(() => { if (value) { QRCode.toDataURL(value, { errorCorrectionLevel: 'Q', type: 'image/png', width: 512, margin: 2, }) .then(setDataUrl) .catch(console.error); } }, [value]); if (!dataUrl) return null; return (
SeedPGP QR Code
); };