From 6bbf1dbd94355f34f58f4b72f134f3dbeac776aa Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 23 Nov 2024 11:55:59 +0700
Subject: <iman> update tempo

---
 src/lib/pengajuan-tempo/component/Dokumen.jsx | 110 +++++++++++++++++---------
 1 file changed, 71 insertions(+), 39 deletions(-)

(limited to 'src/lib/pengajuan-tempo/component/Dokumen.jsx')

diff --git a/src/lib/pengajuan-tempo/component/Dokumen.jsx b/src/lib/pengajuan-tempo/component/Dokumen.jsx
index 0873df66..8391de4a 100644
--- a/src/lib/pengajuan-tempo/component/Dokumen.jsx
+++ b/src/lib/pengajuan-tempo/component/Dokumen.jsx
@@ -43,8 +43,8 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
       }
 
       // Check for file size
-      if (file.size > 2000000) {
-        toast.error('Maksimal ukuran file adalah 2MB', { duration: 4000 });
+      if (file.size > 500000) {
+        toast.error('Maksimal ukuran file adalah 500Kb', { duration: 4000 });
 
         event.target.value = '';
         return;
@@ -72,6 +72,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
   const dokumenTempatBekerjaRef = useRef(null);
 
   useEffect(() => {
+    // window.scrollTo({
+    //   top: 0,
+    //   behavior: 'smooth',
+    // });
     const loadIndustries = async () => {
       if (!isFormValid) {
         const options = {
@@ -79,6 +83,7 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
           block: 'center',
         };
         if (errorsDokumen.dokumenNib && dokumenNibRef.current) {
+          console.log('errorsDokumen', errorsDokumen);
           dokumenNibRef.current.scrollIntoView(options);
           return;
         }
@@ -144,7 +149,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
           <form className='flex mt-4 flex-col w-full '>
             <div className='w-full grid grid-cols-[1fr_auto_1fr] gap-5'>
               <div className='kolom-kiri w-full grid grid-rows-2 gap-7 '>
-                <div className='w-full grid grid-cols-2 gap-5'>
+                <div
+                  className='w-full grid grid-cols-2 gap-5'
+                  ref={dokumenNibRef}
+                >
                   <div>
                     <label className='form-label  text-nowrap'>
                       NIB (SIUP/TDP/SKDP)
@@ -167,7 +175,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                         name='dokumenNib'
                         type='file'
                         title=' '
-                        ref={dokumenNibRef}
                         className='hidden'
                         aria-invalid={errorsDokumen.dokumenNib}
                         onChange={handleInputChange}
@@ -184,7 +191,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     )}
                   </div>
                 </div>
-                <div className='w-full grid grid-cols-2 gap-5'>
+                <div
+                  className='w-full grid grid-cols-2 gap-5'
+                  ref={dokumenNpwpRef}
+                >
                   <div>
                     <label className='form-label  text-nowrap'>
                       NPWP Perusahaan
@@ -206,7 +216,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                         id='dokumenNpwp'
                         name='dokumenNpwp'
                         type='file'
-                        ref={dokumenNpwpRef}
                         title=' '
                         className='hidden'
                         aria-invalid={errorsDokumen.dokumenNpwp}
@@ -224,7 +233,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     )}
                   </div>
                 </div>
-                <div className='w-full grid grid-cols-2 gap-5'>
+                <div
+                  className='w-full grid grid-cols-2 gap-5'
+                  ref={dokumenSppkpRef}
+                >
                   <div>
                     <label className='form-label  text-nowrap'>SPPKP</label>
                     <span className='text-xs opacity-60'>
@@ -244,7 +256,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                         id='dokumenSppkp'
                         name='dokumenSppkp'
                         type='file'
-                        ref={dokumenSppkpRef}
                         className='hidden'
                         aria-invalid={errorsDokumen.dokumenSppkp}
                         onChange={handleInputChange}
@@ -262,7 +273,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     )}
                   </div>
                 </div>
-                <div className='w-full grid grid-cols-2 gap-5'>
+                <div
+                  className='w-full grid grid-cols-2 gap-5'
+                  ref={dokumenAktaPerubahanRef}
+                >
                   <div>
                     <label className='form-label  text-nowrap'>
                       Akta Perubahan{' '}
@@ -285,7 +299,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                         id='dokumenAktaPerubahan'
                         name='dokumenAktaPerubahan'
                         type='file'
-                        ref={dokumenAktaPerubahanRef}
                         className='hidden'
                         aria-invalid={errorsDokumen.dokumenAktaPerubahan}
                         onChange={handleInputChange}
@@ -302,7 +315,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     )}
                   </div>
                 </div>
-                <div className='w-full grid grid-cols-2 gap-5'>
+                <div
+                  className='w-full grid grid-cols-2 gap-5'
+                  ref={dokumenKtpDirutRef}
+                >
                   <div>
                     <label className='form-label  text-nowrap'>
                       KTP Dirut/Direktur{' '}
@@ -325,7 +341,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                         id='dokumenKtpDirut'
                         name='dokumenKtpDirut'
                         type='file'
-                        ref={dokumenKtpDirutRef}
                         className='hidden'
                         aria-invalid={errorsDokumen.dokumenKtpDirut}
                         onChange={handleInputChange}
@@ -345,7 +360,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                 </div>
               </div>
               <div className='w-px bg-gray-300'></div>
-              <div className='kolom kanan w-full grid grid-rows-2 gap-10 '>
+              <div
+                className='kolom kanan w-full grid grid-rows-2 gap-10 '
+                ref={dokumenAktaPendirianRef}
+              >
                 <div className='w-full grid grid-cols-2 gap-5'>
                   <div>
                     <label className='form-label  text-nowrap'>
@@ -369,7 +387,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                         id='dokumenAktaPendirian'
                         name='dokumenAktaPendirian'
                         type='file'
-                        ref={dokumenAktaPendirianRef}
                         className='hidden'
                         aria-invalid={errorsDokumen.dokumenAktaPendirian}
                         onChange={handleInputChange}
@@ -387,7 +404,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     )}
                   </div>
                 </div>
-                <div className='w-full grid grid-cols-2 gap-5'>
+                <div
+                  className='w-full grid grid-cols-2 gap-5'
+                  ref={dokumenLaporanKeuanganRef}
+                >
                   <div>
                     <label className='form-label  text-nowrap'>
                       Laporan Keuangan
@@ -410,7 +430,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                         id='dokumenLaporanKeuangan'
                         name='dokumenLaporanKeuangan'
                         type='file'
-                        ref={dokumenLaporanKeuanganRef}
                         className='hidden'
                         aria-invalid={errorsDokumen.dokumenLaporanKeuangan}
                         onChange={handleInputChange}
@@ -428,7 +447,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     )}
                   </div>
                 </div>
-                <div className='w-full grid grid-cols-2 gap-5'>
+                <div
+                  className='w-full grid grid-cols-2 gap-5'
+                  ref={dokumenFotoKantorRef}
+                >
                   <div>
                     <label className='form-label  text-nowrap'>
                       Foto Kantor (Tampak Depan)
@@ -450,7 +472,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                         id='dokumenFotoKantor'
                         name='dokumenFotoKantor'
                         type='file'
-                        ref={dokumenFotoKantorRef}
                         className='hidden'
                         aria-invalid={errorsDokumen.dokumenFotoKantor}
                         onChange={handleInputChange}
@@ -468,7 +489,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     )}
                   </div>
                 </div>
-                <div className='w-full grid grid-cols-2 gap-5'>
+                <div
+                  className='w-full grid grid-cols-2 gap-5'
+                  ref={dokumenTempatBekerjaRef}
+                >
                   <div>
                     <label className='form-label  text-nowrap'>
                       Tempat Bekerja
@@ -490,7 +514,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                         id='dokumenTempatBekerja'
                         name='dokumenTempatBekerja'
                         type='file'
-                        ref={dokumenTempatBekerjaRef}
                         className='hidden'
                         aria-invalid={errorsDokumen.dokumenTempatBekerja}
                         onChange={handleInputChange}
@@ -538,7 +561,7 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
               labelColor='#e80909'
               labelSize='0'
               maxCompleted={9}
-              height='14  px'
+              height='14px'
             />
             <span className='opacity-75'>
               Tingkatin sedikit lagi agar pengajuan tempo kamu dapat kami proses
@@ -558,7 +581,7 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
           </h1>
           <form className='flex mt-4 flex-col w-full '>
             <div className='w-full flex flex-col gap-4'>
-              <div className='w-full flex flex-col gap-2'>
+              <div className='w-full flex flex-col gap-2' ref={dokumenNibRef}>
                 <label className='form-label  text-nowrap'>
                   NIB (SIUP/TDP/SKDP)
                 </label>
@@ -577,7 +600,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     name='dokumenNib'
                     type='file'
                     title=' '
-                    ref={dokumenNibRef}
                     className='hidden'
                     aria-invalid={errorsDokumen.dokumenNib}
                     onChange={handleInputChange}
@@ -597,7 +619,7 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                 )}
               </div>
 
-              <div className='w-full flex flex-col gap-2'>
+              <div className='w-full flex flex-col gap-2' ref={dokumenNpwpRef}>
                 <label className='form-label  text-nowrap'>
                   NPWP Perusahaan
                 </label>
@@ -615,7 +637,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     id='dokumenNpwp'
                     name='dokumenNpwp'
                     type='file'
-                    ref={dokumenNpwpRef}
                     title=' '
                     className='hidden'
                     aria-invalid={errorsDokumen.dokumenNpwp}
@@ -636,7 +657,7 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                 )}
               </div>
 
-              <div className='w-full flex flex-col gap-2'>
+              <div className='w-full flex flex-col gap-2' ref={dokumenSppkpRef}>
                 <label className='form-label  text-nowrap'>SPPKP</label>
                 <div className='flex flex-row gap-2'>
                   <label
@@ -652,7 +673,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     id='dokumenSppkp'
                     name='dokumenSppkp'
                     type='file'
-                    ref={dokumenSppkpRef}
                     title=' '
                     className='hidden'
                     aria-invalid={errorsDokumen.dokumenSppkp}
@@ -673,7 +693,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                 )}
               </div>
 
-              <div className='w-full flex flex-col gap-2'>
+              <div
+                className='w-full flex flex-col gap-2'
+                ref={dokumenAktaPerubahanRef}
+              >
                 <label className='form-label  text-nowrap'>
                   Akta Perubahan <span className=' opacity-60'>(Opsional)</span>
                 </label>
@@ -691,7 +714,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     id='dokumenAktaPerubahan'
                     name='dokumenAktaPerubahan'
                     type='file'
-                    ref={dokumenAktaPerubahanRef}
                     title=' '
                     className='hidden'
                     aria-invalid={errorsDokumen.dokumenAktaPerubahan}
@@ -712,7 +734,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                 )}
               </div>
 
-              <div className='w-full flex flex-col gap-2'>
+              <div
+                className='w-full flex flex-col gap-2'
+                ref={dokumenKtpDirutRef}
+              >
                 <label className='form-label  text-nowrap'>
                   KTP Dirut/Direktur{' '}
                   <span className=' opacity-60'>(Opsional)</span>
@@ -731,7 +756,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     id='dokumenKtpDirut'
                     name='dokumenKtpDirut'
                     type='file'
-                    ref={dokumenKtpDirutRef}
                     title=' '
                     className='hidden'
                     aria-invalid={errorsDokumen.dokumenKtpDirut}
@@ -752,7 +776,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                 )}
               </div>
 
-              <div className='w-full flex flex-col gap-2'>
+              <div
+                className='w-full flex flex-col gap-2'
+                ref={dokumenAktaPendirianRef}
+              >
                 <label className='form-label  text-nowrap'>
                   Akta Pendirian <span className=' opacity-60'>(Opsional)</span>
                 </label>
@@ -770,7 +797,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     id='dokumenAktaPendirian'
                     name='dokumenAktaPendirian'
                     type='file'
-                    ref={dokumenAktaPendirianRef}
                     title=' '
                     className='hidden'
                     aria-invalid={errorsDokumen.dokumenAktaPendirian}
@@ -791,7 +817,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                 )}
               </div>
 
-              <div className='w-full flex flex-col gap-2'>
+              <div
+                className='w-full flex flex-col gap-2'
+                ref={dokumenLaporanKeuanganRef}
+              >
                 <label className='form-label  text-nowrap'>
                   Laporan Keuangan{' '}
                   <span className=' opacity-60'>(Opsional)</span>
@@ -810,7 +839,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     id='dokumenLaporanKeuangan'
                     name='dokumenLaporanKeuangan'
                     type='file'
-                    ref={dokumenLaporanKeuanganRef}
                     title=' '
                     className='hidden'
                     aria-invalid={errorsDokumen.dokumenLaporanKeuangan}
@@ -831,7 +859,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                 )}
               </div>
 
-              <div className='w-full flex flex-col gap-2'>
+              <div
+                className='w-full flex flex-col gap-2'
+                ref={dokumenFotoKantorRef}
+              >
                 <label className='form-label  text-nowrap'>
                   Foto Kantor (Tampak Depan)
                 </label>
@@ -849,7 +880,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     id='dokumenFotoKantor'
                     name='dokumenFotoKantor'
                     type='file'
-                    ref={dokumenFotoKantorRef}
                     title=' '
                     className='hidden'
                     aria-invalid={errorsDokumen.dokumenFotoKantor}
@@ -870,7 +900,10 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                 )}
               </div>
 
-              <div className='w-full flex flex-col gap-2'>
+              <div
+                className='w-full flex flex-col gap-2'
+                ref={dokumenTempatBekerjaRef}
+              >
                 <label className='form-label  text-nowrap'>
                   Tempat Bekerja
                 </label>
@@ -888,7 +921,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
                     id='dokumenTempatBekerja'
                     name='dokumenTempatBekerja'
                     type='file'
-                    ref={dokumenTempatBekerjaRef}
                     title=' '
                     className='hidden'
                     aria-invalid={errorsDokumen.dokumenTempatBekerja}
-- 
cgit v1.2.3

