From c19c7eee924b70d25cb47d40fd7c8e00d5efa867 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 23 Oct 2024 17:07:37 +0700
Subject: <iman> update pengajuan tempo section konfirmasi

---
 src/lib/pengajuan-tempo/component/Konfirmasi.jsx | 351 ++---------------------
 1 file changed, 16 insertions(+), 335 deletions(-)

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

diff --git a/src/lib/pengajuan-tempo/component/Konfirmasi.jsx b/src/lib/pengajuan-tempo/component/Konfirmasi.jsx
index a03bc59e..4950161e 100644
--- a/src/lib/pengajuan-tempo/component/Konfirmasi.jsx
+++ b/src/lib/pengajuan-tempo/component/Konfirmasi.jsx
@@ -5,16 +5,19 @@ import {
   usePengajuanTempoStoreDokumen,
   usePengajuanTempoStore,
 } from '../../../../src-migrate/modules/register/stores/usePengajuanTempoStore';
+import KontakPerusahaan from './KontakPerusahaan';
 import ProgressBar from '@ramonak/react-progress-bar';
 import { UseToastOptions } from '@chakra-ui/react';
 import odooApi from '~/libs/odooApi';
 import { toast } from 'react-hot-toast';
 import getFileBase64 from '@/core/utils/getFileBase64';
 import { CheckCircleIcon } from '@heroicons/react/24/outline';
-const Dokumen = ({ chekValid, buttonSubmitClick }) => {
+import InformasiPerusahaan from './informasiPerusahaan';
+import Pengiriman from './Pengiriman';
+import KonfirmasiDokumen from './KonfirmasiDokumen';
+const Konfirmasi = ({ chekValid, buttonSubmitClick }) => {
   const { control, watch, setValue, getValues } = useForm();
   const [industries, setIndustries] = useState([]);
-  const [industriesOpen, setIndustriesOpen] = useState(false);
   const {
     formDokumen,
     errorsDokumen,
@@ -63,7 +66,6 @@ const Dokumen = ({ chekValid, buttonSubmitClick }) => {
     () => Object.keys(errorsDokumen).length === 0,
     [errorsDokumen]
   );
-  const selectRef = useRef(null);
   const dokumenNibRef = useRef(null);
   const dokumenNpwpRef = useRef(null);
   const dokumenSppkpRef = useRef(null);
@@ -174,345 +176,24 @@ const Dokumen = ({ chekValid, buttonSubmitClick }) => {
     <>
       <form className='flex mt-4 flex-col w-full '>
         <div className='w-full grid grid-cols-[1fr_auto_1fr] gap-5'>
-          <div className='w-full grid grid-rows-[1fc_auto_ifc] gap-5'>
-            <div className='kolom-kiri w-full grid grid-rows-2 gap-7 '>
-              <div className='flex justify-start'>
-                <h2 className='font-bold text-xl'>Informasi Usaha</h2>
-              </div>
-              <div className='w-full flex flex-row items-start gap-5'>
-                <div className='w-1/3'>
-                  <label className='form-label  text-nowrap'>
-                    Nama Perusahaan
-                  </label>
-                </div>
-                <div className='w-2/3'>
-                  <div className='flex flex-row items-center gap-2'>
-                    <div className='relative w-11/12'>
-                      <input
-                        value={form.name}
-                        id='name'
-                        name='name'
-                        type='text'
-                        className='form-input bg-gray_r-2 focus:bg-white new w-full pr-16'
-                        aria-invalid={errors.name}
-                        onChange={handleInputChange}
-                      />
-                      <label
-                        htmlFor='name'
-                        className='absolute right-0 top-0 cursor-pointer  text-red-500 py-2 px-4 '
-                      >
-                        Ubah
-                      </label>
-                    </div>
-                    <CheckCircleIcon className='w-6 text-green-700 ring-green-600/20 bg-green-50' />
-                  </div>
-                  {chekValid && (
-                    <div className='text-caption-2 text-danger-500 mt-1'>
-                      {errors.name}
-                    </div>
-                  )}
-                </div>
-              </div>
-              <div className='w-full flex flex-row items-start gap-5'>
-                <div className='w-1/3'>
-                  <label className='form-label  text-nowrap'>Industri</label>
-                </div>
-                <div className='w-2/3'>
-                  <div className='flex flex-row items-center gap-2'>
-                    <div className='relative w-11/12'>
-                      <Controller
-                        inputId='industry_id'
-                        name='industry_id'
-                        control={control}
-                        render={(props) => (
-                          <HookFormSelect
-                            {...props}
-                            inputId='industry_id'
-                            name='industry_id'
-                            ref={selectRef}
-                            options={industries}
-                            menuIsOpen={industriesOpen}
-                            placeholder={'Pilih industri bisnis anda'}
-                          />
-                        )}
-                      />
-                      <label
-                        htmlFor='industry_id'
-                        // onClick={handleLabelClick}
-                        className='absolute right-0 top-0 cursor-pointer  text-red-500 py-2 px-4 '
-                      >
-                        Ubah
-                      </label>
-                    </div>
-                    <CheckCircleIcon className='w-6 text-green-700 ring-green-600/20 bg-green-50' />
-                  </div>
-                  {chekValid && (
-                    <div className='text-caption-2 text-danger-500 mt-1'>
-                      {errors.industry_id}
-                    </div>
-                  )}
-                </div>
-              </div>
-              <div className='w-full flex flex-row items-start gap-5'>
-                <div className='w-1/3'>
-                  <label className='form-label  text-nowrap'>
-                    Alamat Perusahaan
-                  </label>
-                </div>
-                <div className='w-2/3'>
-                  <div className='flex flex-row items-center gap-2'>
-                    <div className='relative w-11/12'>
-                      {/* Input field */}
-                      <input
-                        value={form.street}
-                        id='street'
-                        name='street'
-                        type='text'
-                        className='form-input bg-gray_r-2 focus:bg-white new w-full pr-16' // Tambah padding untuk memberi ruang bagi label
-                        aria-invalid={errors.street}
-                        onChange={handleInputChange}
-                      />
-
-                      {/* Label "ubah" di pojok kanan */}
-                      <label
-                        htmlFor='street'
-                        className='absolute right-0 top-0 cursor-pointer  text-red-500 py-2 px-4 '
-                      >
-                        Ubah
-                      </label>
-
-                      {/* Pesan kesalahan */}
-                    </div>
-                    <CheckCircleIcon className='w-6 text-green-700 ring-green-600/20 bg-green-50' />
-                  </div>
-                  {chekValid && (
-                    <div className='text-caption-2 text-danger-500 mt-1'>
-                      {errors.street}
-                    </div>
-                  )}
-                </div>
-              </div>
-              <div className='w-full flex flex-row items-start gap-5'>
-                <div className='w-1/3'>
-                  <label className='form-label  text-nowrap'>
-                    No. Telfon Perusahaan
-                  </label>
-                </div>
-                <div className='w-2/3'>
-                  <div className='flex flex-row items-center gap-2'>
-                    <div className='relative w-11/12'>
-                      {/* Input field */}
-                      <input
-                        value={form.mobile}
-                        id='mobile'
-                        name='mobile'
-                        type='text'
-                        className='form-input bg-gray_r-2 focus:bg-white new w-full pr-16' // Tambah padding untuk memberi ruang bagi label
-                        aria-invalid={errors.mobile}
-                        onChange={handleInputChange}
-                      />
-
-                      {/* Label "ubah" di pojok kanan */}
-                      <label
-                        htmlFor='mobile'
-                        className='absolute right-0 top-0 cursor-pointer  text-red-500 py-2 px-4 '
-                      >
-                        Ubah
-                      </label>
-
-                      {/* Pesan kesalahan */}
-                    </div>
-                    <CheckCircleIcon className='w-6 text-green-700 ring-green-600/20 bg-green-50' />
-                  </div>
-                  {chekValid && (
-                    <div className='text-caption-2 text-danger-500 mt-1'>
-                      {errors.mobile}
-                    </div>
-                  )}
-                </div>
-              </div>
-              <div className='w-full flex flex-row items-start gap-5'>
-                <div className='w-1/3'>
-                  <label className='form-label  text-nowrap'>Data Bank</label>
-                </div>
-                <div className='w-2/3'>
-                  <div className='flex flex-row items-center gap-2'>
-                    <div className='relative w-11/12'>
-                      {/* Input field */}
-                      <input
-                        value={form.accountName}
-                        id='accountName'
-                        name='accountName'
-                        type='text'
-                        className='form-input bg-gray_r-2 focus:bg-white new w-full pr-16' // Tambah padding untuk memberi ruang bagi label
-                        aria-invalid={errors.accountName}
-                        onChange={handleInputChange}
-                      />
-
-                      {/* Label "ubah" di pojok kanan */}
-                      <label
-                        htmlFor='accountName'
-                        className='absolute right-0 top-0 cursor-pointer  text-red-500 py-2 px-4 '
-                      >
-                        Ubah
-                      </label>
-
-                      {/* Pesan kesalahan */}
-                    </div>
-                    <CheckCircleIcon className='w-6 text-green-700 ring-green-600/20 bg-green-50' />
-                  </div>
-                  {chekValid && (
-                    <div className='text-caption-2 text-danger-500 mt-1'>
-                      {errors.accountName}
-                    </div>
-                  )}
-                </div>
-              </div>
+          <div className='w-full flex flex-col gap-5 '>
+            <div className=''>
+              <InformasiPerusahaan isKonfirmasi={true} />
             </div>
             <div className='h-px bg-gray-300'></div>
-            <div className='kolom-kiri w-full grid grid-rows-2 gap-7 '>
-              <div className='flex justify-start'>
-                <h2 className='font-bold text-xl'>Informasi Usaha</h2>
-              </div>
-              <div className='w-full grid grid-cols-2 gap-5'>
-                <div>
-                  <label className='form-label  text-nowrap'>
-                    NIB (SIUP/TDP/SKDP)
-                  </label>
-                  <span className='text-xs opacity-60'>
-                    Pastikan dokumen yang anda upload sudah benar
-                  </span>
-                </div>
-                <div className=''>
-                  <div className='flex flex-col items-start'>
-                    <label
-                      htmlFor='dokumenNib'
-                      className='cursor-pointer bg-gray-200 hover:bg-gray-300 text-gray-700 py-2 px-4 rounded'
-                    >
-                      Upload Dokumen
-                    </label>
-                    <input
-                      // value={formDokumen?.dokumenNib?.name}
-                      id='dokumenNib'
-                      name='dokumenNib'
-                      type='file'
-                      title=' '
-                      ref={dokumenNibRef}
-                      className='hidden'
-                      aria-invalid={errorsDokumen.dokumenNib}
-                      onChange={handleInputChange}
-                      accept='.pdf,.png,.jpg,.jpeg'
-                    />
-                    <span className='mt-2 text-gray-600'>
-                      {formDokumen?.dokumenNib?.name}
-                    </span>
-                  </div>
-                  {chekValid && (
-                    <div className='text-caption-2 text-danger-500 mt-1'>
-                      {errorsDokumen.dokumenNib}
-                    </div>
-                  )}
-                </div>
-              </div>
+            <div className=''>
+              <KontakPerusahaan isKonfirmasi={true} />
             </div>
           </div>
 
           <div className='w-px bg-gray-300'></div>
-          <div className='w-full grid grid-rows-[1fc_auto_ifc] gap-5'>
-            <div className='kolom kanan w-full grid grid-rows-2 gap-10 '>
-              <div className='flex justify-start'>
-                <h2 className='font-bold text-xl'>Pengiriman</h2>
-              </div>
-              <div className='w-full grid grid-cols-2 gap-5'>
-                <div>
-                  <label className='form-label  text-nowrap'>
-                    Akta Pendirian{' '}
-                    <span className=' opacity-60'>(Opsional)</span>
-                  </label>
-                  <span className='text-xs opacity-60'>
-                    Pastikan dokumen yang anda upload sudah benar
-                  </span>
-                </div>
-                <div className=''>
-                  <div className='flex flex-col items-start'>
-                    <label
-                      htmlFor='dokumenAktaPendirian'
-                      className='cursor-pointer bg-gray-200 hover:bg-gray-300 text-gray-700 py-2 px-4 rounded'
-                    >
-                      Upload Dokumen
-                    </label>
-                    <input
-                      // value={formDokumen.dokumenAktaPendirian}
-                      id='dokumenAktaPendirian'
-                      name='dokumenAktaPendirian'
-                      type='file'
-                      ref={dokumenAktaPendirianRef}
-                      className='hidden'
-                      aria-invalid={errorsDokumen.dokumenAktaPendirian}
-                      onChange={handleInputChange}
-                      accept='.pdf,.png,.jpg,.jpeg'
-                    />
-                    <span className='mt-2 text-gray-600'>
-                      {formDokumen?.dokumenAktaPendirian?.name}
-                    </span>
-                  </div>
-
-                  {chekValid && (
-                    <div className='text-caption-2 text-danger-500 mt-1'>
-                      {errorsDokumen.dokumenAktaPendirian}
-                    </div>
-                  )}
-                </div>
-              </div>
-              <div></div>
+          <div className='w-full grid grid-rows-[1fc_auto_1fc] gap-5'>
+            <div>
+              <Pengiriman isKonfirmasi={true} />
             </div>
             <div className='h-px bg-gray-300'></div>
-            <div className='kolom kanan w-full grid grid-rows-2 gap-10 '>
-              <div className='flex justify-start'>
-                <h2 className='font-bold text-xl'>Pengiriman</h2>
-              </div>
-              <div className='w-full grid grid-cols-2 gap-5'>
-                <div>
-                  <label className='form-label  text-nowrap'>
-                    Akta Pendirian{' '}
-                    <span className=' opacity-60'>(Opsional)</span>
-                  </label>
-                  <span className='text-xs opacity-60'>
-                    Pastikan dokumen yang anda upload sudah benar
-                  </span>
-                </div>
-                <div className=''>
-                  <div className='flex flex-col items-start'>
-                    <label
-                      htmlFor='dokumenAktaPendirian'
-                      className='cursor-pointer bg-gray-200 hover:bg-gray-300 text-gray-700 py-2 px-4 rounded'
-                    >
-                      Upload Dokumen
-                    </label>
-                    <input
-                      // value={formDokumen.dokumenAktaPendirian}
-                      id='dokumenAktaPendirian'
-                      name='dokumenAktaPendirian'
-                      type='file'
-                      ref={dokumenAktaPendirianRef}
-                      className='hidden'
-                      aria-invalid={errorsDokumen.dokumenAktaPendirian}
-                      onChange={handleInputChange}
-                      accept='.pdf,.png,.jpg,.jpeg'
-                    />
-                    <span className='mt-2 text-gray-600'>
-                      {formDokumen?.dokumenAktaPendirian?.name}
-                    </span>
-                  </div>
-
-                  {chekValid && (
-                    <div className='text-caption-2 text-danger-500 mt-1'>
-                      {errorsDokumen.dokumenAktaPendirian}
-                    </div>
-                  )}
-                </div>
-              </div>
-              <div></div>
+            <div>
+              <KonfirmasiDokumen isKonfirmasi={true} />
             </div>
           </div>
         </div>
@@ -521,4 +202,4 @@ const Dokumen = ({ chekValid, buttonSubmitClick }) => {
   );
 };
 
-export default Dokumen;
+export default Konfirmasi;
-- 
cgit v1.2.3

