From 6fb08ca0ad016cc4d20e320b8ae0aee110dddc8c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 4 Nov 2024 16:38:02 +0700 Subject: update pengajuan tempo tdk bisa lihat file mobile --- .../component/KonfirmasiDokumen.jsx | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx index 112b85ef..9b0f1d8f 100644 --- a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx +++ b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx @@ -145,6 +145,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { useEffect(() => { validateDokumen(); }, [buttonSubmitClick]); + return ( <> {isDesktop && ( @@ -1146,12 +1147,29 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { width='100%' height='100%' /> */} - + onError={(e) => { + // Jika gagal menampilkan PDF, unduh otomatis + const link = document.createElement('a'); + link.href = `data:${format};base64,${base64}`; + link.download = 'document.pdf'; + link.click(); + }} + > + PDF tidak dapat ditampilkan. + + {' '} + Klik di sini untuk + mengunduh PDF + + )} -- cgit v1.2.3