summaryrefslogtreecommitdiff
path: root/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-12-04 10:59:21 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-12-04 10:59:21 +0700
commit9a49b8d84761781531cb417731cb9ef802f63541 (patch)
tree140f9ca02190789d0d20f8ca13d00f20e81b6adc /src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx
parent77f9843ad5072583cb1797d7ecf5ac80394bad3f (diff)
<iman> update pengajuan tempo
Diffstat (limited to 'src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx')
-rw-r--r--src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx110
1 files changed, 58 insertions, 52 deletions
diff --git a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx
index 9b0f1d8f..c1f2d07c 100644
--- a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx
+++ b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx
@@ -145,7 +145,6 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
useEffect(() => {
validateDokumen();
}, [buttonSubmitClick]);
-
return (
<>
{isDesktop && (
@@ -168,7 +167,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenNib'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -219,7 +218,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenNpwp'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -268,7 +267,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenSppkp'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -321,9 +320,11 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenAktaPerubahan'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
- Ubah
+ {formDokumen.dokumenAktaPerubahan.name
+ ? 'ubah'
+ : 'upload'}
</label>
<input
// value={formDokumen?.dokumenNib?.name}
@@ -374,7 +375,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenKtpDirut'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -426,7 +427,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenAktaPendirian'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -479,7 +480,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenLaporanKeuangan'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -531,7 +532,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenFotoKantor'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -583,7 +584,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenTempatBekerja'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -651,7 +652,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenNib'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -700,7 +701,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenNpwp'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -749,7 +750,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenSppkp'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -802,7 +803,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenAktaPerubahan'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -855,7 +856,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenKtpDirut'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -907,7 +908,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenAktaPendirian'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -960,7 +961,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenLaporanKeuangan'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -1012,7 +1013,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenFotoKantor'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20 text-center'
>
Ubah
</label>
@@ -1062,7 +1063,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<div className='w-2/5 flex flex-row gap-2'>
<label
htmlFor='dokumenTempatBekerja'
- className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded'
+ className='cursor-pointer bg-red-500 hover:bg-red-600 text-white py-1 px-3 text-sm rounded min-w-20'
>
Ubah
</label>
@@ -1118,12 +1119,6 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
close={() => setIsExample(false)}
>
<div className='flex justify-center items-center p-2'>
- {/* <embed
- src={`data:${format};base64,${base64}`}
- type={format}
- width='100%'
- height='600px'
- /> */}
<iframe
src={`data:${format};base64,${base64}`}
width='100%'
@@ -1141,35 +1136,46 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
close={() => setIsExample(false)}
>
<div className='flex justify-center items-center p-2'>
+ {!format.includes('undifined') ? (
+ <object
+ data={`data:${format};base64,${base64}`}
+ type={format}
+ width='100%'
+ height='100%'
+ 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>
+ ) : (
+ <embed
+ src={
+ '/web/image/2540181?unique=7050288dd34d7318bf059e7f362540f6ad5533f9'
+ }
+ width='100%'
+ height='600px'
+ />
+ )}
{/* <embed
- src={`data:${format};base64,${base64}`}
- type={format}
+ src={
+ '/web/image/2540181?unique=7050288dd34d7318bf059e7f362540f6ad5533f9'
+ }
width='100%'
- height='100%'
+ height='600px'
/> */}
- <object
- data={`data:${format};base64,${base64}`}
- type={format}
- width='100%'
- height='100%'
- 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>
)}