import { cx, css } from '@emotion/css' import { useEffect, useRef, useState, useMemo } from 'react' import qrCode from 'qrcode' const QRCode = ({ className, text }: { className?: string; text: string }) => { const [image, setImage] = useState('') useEffect(() => { if (text) { qrCode .toString(text, { margin: 0, color: { light: '#ffffff00' }, type: 'svg', }) .then(image => { setImage(image) console.log(image) }) } }, [text]) const encodedImage = useMemo(() => encodeURIComponent(image), [image]) return ( ) } const Login = () => { return
return (
Log in with NetEase QR
or
{/* Close */}
) } export default Login