summaryrefslogtreecommitdiff
path: root/src/lib/pengajuan-tempo/component
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-11-04 16:38:02 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-11-04 16:38:02 +0700
commit6fb08ca0ad016cc4d20e320b8ae0aee110dddc8c (patch)
tree33d4d1bc5e3a003e859a3dfd914d85a2083d01b1 /src/lib/pengajuan-tempo/component
parentf751fa6d398a8aab96380c832da927c60c6ccbe4 (diff)
<iman> update pengajuan tempo tdk bisa lihat file mobile
Diffstat (limited to 'src/lib/pengajuan-tempo/component')
-rw-r--r--src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx26
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>
)}