handle download poster and qrcode, fix to show timestamp, add pagination to doctors page

This commit is contained in:
ehsan
2025-10-02 02:52:26 +03:30
parent 645da72002
commit e1510b142b
21 changed files with 394 additions and 154 deletions
+33
View File
@@ -0,0 +1,33 @@
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 (
<div className="flex items-center flex-col justify-center mt-[100%]">
{qrCodeData ? (
<img src={qrCodeData} width={167} height={167} />
) : (
<p>در حال بارگذاری...</p>
)}
<p className="text-[#3987D4] min-h-[24px] font-semibold text-[16px] mt-[32px]">
{host || ""}
</p>
</div>
);
}