import { useState, useEffect } from "react"; import QRCode from "qrcode"; import { getStateInfoClient } from "@/lib/getStateInfoClient"; export default function QrImg() { const [host, setHost] = useState(""); const [qrCodeData, setQrCodeData] = useState(""); useEffect(() => { const info = getStateInfoClient(); const linkHost = info.host; const linkURL = info.fullUrl; setHost(linkHost); if (linkURL) { QRCode.toDataURL(linkURL).then(setQrCodeData); } }, []); return (
{qrCodeData ? ( ) : (

در حال بارگذاری...

)}

{host || ""}

); }