|
|
{
const svg: any = document.getElementById(e.id);
const svgData = new XMLSerializer().serializeToString(svg);
const canvas = document.createElement("canvas");
const ctx: any = canvas.getContext("2d");
const img = new Image();
img.onload = () => {
canvas.width = img.width;
canvas.height = img.height;
ctx.drawImage(img, 0, 0);
const pngFile = canvas.toDataURL("image/png");
const downloadLink = document.createElement("a");
downloadLink.download = `QRCode ${e.title}`;
downloadLink.href = `${pngFile}`;
downloadLink.click();
};
img.src = `data:image/svg+xml;base64,${btoa(svgData)}`;
}}
/>
|
{e?.Author?.username}
|
{e.title}
|
{e.lokasi}
|
{e.EventMaster_TipeAcara.name}
|
{" "}
{new Intl.DateTimeFormat("id-ID", {
dateStyle: "full",
}).format(e?.tanggal)}
,{" "}
{new Intl.DateTimeFormat("id-ID", {
timeStyle: "short",
}).format(e?.tanggal)}
|
{" "}
{new Intl.DateTimeFormat("id-ID", {
dateStyle: "full",
}).format(e?.tanggalSelesai)}
,{" "}
{new Intl.DateTimeFormat("id-ID", {
timeStyle: "short",
}).format(e?.tanggalSelesai)}
|
{e.deskripsi}
|
|
))
);
return (
<>