diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-04 16:38:02 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-04 16:38:02 +0700 |
| commit | 6fb08ca0ad016cc4d20e320b8ae0aee110dddc8c (patch) | |
| tree | 33d4d1bc5e3a003e859a3dfd914d85a2083d01b1 | |
| parent | f751fa6d398a8aab96380c832da927c60c6ccbe4 (diff) | |
<iman> update pengajuan tempo tdk bisa lihat file mobile
| -rw-r--r-- | src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx | 26 |
1 files changed, 22 insertions, 4 deletions
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%' /> */} - <iframe - src={`data:${format};base64,${base64}`} + <object + data={`data:${format};base64,${base64}`} + type={format} width='100%' height='100%' - title='Document' - ></iframe> + onError={(e) => { + // Jika <object> 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. + <a + href={`data:${format};base64,${base64}`} + download='document.pdf' + > + {' '} + Klik <span className='text-red-500'>di sini</span> untuk + mengunduh PDF + </a> + </object> </div> </BottomPopup> )} |
