Add component

This commit is contained in:
2025-09-17 12:17:14 +07:00
parent b25aaf124c
commit 4a3ae20b84
19 changed files with 2074 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
const toBase64 = (url) =>
fetch(url)
.then((res) => res.blob())
.then(
(blob) =>
new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onloadend = () => resolve(reader.result);
reader.onerror = reject;
reader.readAsDataURL(blob);
})
);
// Fungsi utama
const kopReportPdf = async (logo, title) => {
const images = await toBase64(logo);
return {
images,
title,
};
};
export { kopReportPdf };