From 0178a1f88d7d34824562e1413be073c0795a47cf Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 16 Dec 2024 17:42:31 +0700
Subject: <iman> update code

---
 .../component/informasiPerusahaan.jsx              | 310 +++++++++++++--------
 1 file changed, 192 insertions(+), 118 deletions(-)

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

diff --git a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx
index f8a0bc55..9850e927 100644
--- a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx
+++ b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx
@@ -640,100 +640,124 @@ const InformasiPerusahaan = ({
                       </div>
                     )}
                   </div>
-                  <div className='sub-alamat flex flex-row w-full gap-3'>
-                    <div className='w-2/5' ref={stateRef}>
-                      <Controller
-                        name='state'
-                        control={control}
-                        render={(props) => (
-                          <HookFormSelect
-                            {...props}
-                            options={states}
-                            placeholder='Provinsi'
-                          />
+                  <div
+                    className={` sub-alamat flex ${
+                      isKonfirmasi ? 'flex-col' : 'flex-row'
+                    } w-full gap-3`}
+                  >
+                    <div
+                      className={`flex  ${
+                        isKonfirmasi
+                          ? ' flex-row gap-3 w-full'
+                          : 'flex-row gap-3 w-2/5'
+                      }`}
+                    >
+                      <div
+                        className={`${isKonfirmasi ? 'w-full' : 'w-full'}`}
+                        ref={stateRef}
+                      >
+                        <Controller
+                          name='state'
+                          control={control}
+                          render={(props) => (
+                            <HookFormSelect
+                              {...props}
+                              options={states}
+                              placeholder='Provinsi'
+                            />
+                          )}
+                        />
+                        {chekValid && (
+                          <div className='text-caption-2 text-danger-500 mt-1'>
+                            {errors.state}
+                          </div>
                         )}
-                      />
-                      {chekValid && (
-                        <div className='text-caption-2 text-danger-500 mt-1'>
-                          {errors.state}
-                        </div>
-                      )}
-                    </div>
-                    <div className='w-1/3' ref={cityRef}>
-                      <Controller
-                        name='city'
-                        control={control}
-                        render={(props) => (
-                          <HookFormSelect
-                            {...props}
-                            options={cities}
-                            disabled={!watchState}
-                            placeholder='Kota'
-                          />
+                      </div>
+                      <div
+                        className={`${isKonfirmasi ? 'w-full' : 'w-full'}`}
+                        ref={cityRef}
+                      >
+                        <Controller
+                          name='city'
+                          control={control}
+                          render={(props) => (
+                            <HookFormSelect
+                              {...props}
+                              options={cities}
+                              disabled={!watchState}
+                              placeholder='Kota'
+                            />
+                          )}
+                        />
+                        {chekValid && (
+                          <div className='text-caption-2 text-danger-500 mt-1'>
+                            {errors.city}
+                          </div>
                         )}
-                      />
-                      {chekValid && (
-                        <div className='text-caption-2 text-danger-500 mt-1'>
-                          {errors.city}
-                        </div>
-                      )}
+                      </div>
                     </div>
-                    <div className='w-1/3' ref={districtRef}>
-                      <Controller
-                        name='district'
-                        control={control}
-                        render={(props) => (
-                          <HookFormSelect
-                            {...props}
-                            options={districts}
-                            disabled={!watchState || !watchCity}
-                            placeholder='Kecamatan'
-                          />
+                    <div
+                      className={`flex-row flex gap-2 justify-between  ${
+                        isKonfirmasi ? 'w-full' : 'w-3/5'
+                      }`}
+                    >
+                      <div className='w-full' ref={districtRef}>
+                        <Controller
+                          name='district'
+                          control={control}
+                          render={(props) => (
+                            <HookFormSelect
+                              {...props}
+                              options={districts}
+                              disabled={!watchState || !watchCity}
+                              placeholder='Kecamatan'
+                            />
+                          )}
+                        />
+                        {chekValid && (
+                          <div className='text-caption-2 text-danger-500 mt-1'>
+                            {errors.district}
+                          </div>
                         )}
-                      />
-                      {chekValid && (
-                        <div className='text-caption-2 text-danger-500 mt-1'>
-                          {errors.district}
-                        </div>
-                      )}
-                    </div>
-                    <div className='w-1/3' ref={subDistrictRef}>
-                      <Controller
-                        name='subDistrict'
-                        control={control}
-                        render={(props) => (
-                          <HookFormSelect
-                            {...props}
-                            options={subDistricts}
-                            disabled={!watchDistrict}
-                            placeholder='Kelurahan'
-                          />
+                      </div>
+                      <div className='w-full' ref={subDistrictRef}>
+                        <Controller
+                          name='subDistrict'
+                          control={control}
+                          render={(props) => (
+                            <HookFormSelect
+                              {...props}
+                              options={subDistricts}
+                              disabled={!watchDistrict}
+                              placeholder='Kelurahan'
+                            />
+                          )}
+                        />
+                        {chekValid && (
+                          <div className='text-caption-2 text-danger-500 mt-1'>
+                            {errors.district}
+                          </div>
                         )}
-                      />
-                      {chekValid && (
-                        <div className='text-caption-2 text-danger-500 mt-1'>
-                          {errors.district}
-                        </div>
-                      )}
-                    </div>
-                    <div className='w-1/3' ref={zipRef}>
-                      <Controller
-                        name='zip'
-                        control={control}
-                        render={(props) => (
-                          <HookFormSelect
-                            {...props}
-                            options={zips}
-                            disabled={!watchsubDistrict}
-                            placeholder='Zip'
-                          />
+                      </div>
+                      <div className='w-full' ref={zipRef}>
+                        <Controller
+                          name='zip'
+                          control={control}
+                          render={(props) => (
+                            <HookFormSelect
+                              {...props}
+                              options={zips}
+                              disabled={!watchsubDistrict}
+                              placeholder='Zip'
+                            />
+                          )}
+                        />
+                        {chekValid && (
+                          <div className='text-caption-2 text-danger-500 mt-1'>
+                            {errors.zip}
+                          </div>
                         )}
-                      />
-                      {chekValid && (
-                        <div className='text-caption-2 text-danger-500 mt-1'>
-                          {errors.district}
-                        </div>
-                      )}
+                      </div>
                     </div>
                     {/* <div className='w-1/3'>
                       <input
@@ -1163,9 +1187,14 @@ const InformasiPerusahaan = ({
                   className='form-input'
                   onChange={handleInputChange}
                 />
-                <div className='w-full text-nowrap'>
-                  <div className='sub-alamat flex flex-row w-full gap-3'>
-                    <div className='w-2/5' ref={stateRef}>
+                {chekValid && (
+                  <div className='text-caption-2 text-danger-500 mt-1'>
+                    {errors.street}
+                  </div>
+                )}
+                <div className='w-full text-warp gap-3 flex flex-col'>
+                  <div className='sub-alamat flex flex-row w-full gap-3 '>
+                    <div className='w-full' ref={stateRef}>
                       <Controller
                         name='state'
                         control={control}
@@ -1183,7 +1212,7 @@ const InformasiPerusahaan = ({
                         </div>
                       )}
                     </div>
-                    <div className='w-1/3' ref={cityRef}>
+                    <div className='w-full' ref={cityRef}>
                       <Controller
                         name='city'
                         control={control}
@@ -1202,7 +1231,9 @@ const InformasiPerusahaan = ({
                         </div>
                       )}
                     </div>
-                    <div className='w-1/3' ref={districtRef}>
+                  </div>
+                  <div className='flex flex-row gap-3'>
+                    <div className='w-full' ref={districtRef}>
                       <Controller
                         name='district'
                         control={control}
@@ -1221,16 +1252,37 @@ const InformasiPerusahaan = ({
                         </div>
                       )}
                     </div>
-                    <div className='w-1/3'>
-                      <input
-                        id='zip'
+                    <div className='w-full' ref={subDistrictRef}>
+                      <Controller
+                        name='subDistrict'
+                        control={control}
+                        render={(props) => (
+                          <HookFormSelect
+                            {...props}
+                            options={subDistricts}
+                            disabled={!watchDistrict}
+                            placeholder='Kelurahan'
+                          />
+                        )}
+                      />
+                      {chekValid && (
+                        <div className='text-caption-2 text-danger-500 mt-1'>
+                          {errors.district}
+                        </div>
+                      )}
+                    </div>
+                    <div className='w-full'>
+                      <Controller
                         name='zip'
-                        ref={zipRef}
-                        placeholder='Kode Pos'
-                        type='number'
-                        value={form.zip}
-                        className='form-input'
-                        onChange={handleInputChange}
+                        control={control}
+                        render={(props) => (
+                          <HookFormSelect
+                            {...props}
+                            options={zips}
+                            disabled={!watchsubDistrict}
+                            placeholder='Zip'
+                          />
+                        )}
                       />
                       {chekValid && (
                         <div className='text-caption-2 text-danger-500 mt-1'>
@@ -1245,11 +1297,6 @@ const InformasiPerusahaan = ({
                     Isi detail alamat sesuai dengan yang terdaftar
                   </span>
                 )}
-                {chekValid && (
-                  <div className='text-caption-2 text-danger-500 mt-1'>
-                    {errors.street}
-                  </div>
-                )}
               </div>
 
               <div className='flex flex-col gap-2  justify-between items-start'>
@@ -1279,6 +1326,11 @@ const InformasiPerusahaan = ({
 
               <div className='flex flex-col gap-2  justify-between items-start'>
                 <label className='form-label'>Data Bank</label>
+                {!isKonfirmasi && (
+                  <span className='text-xs opacity-60'>
+                    Isi data bank perusahaan sesuai dengan yang terdaftar
+                  </span>
+                )}
                 <div className='flex gap-3 flex-row'>
                   <div>
                     <input
@@ -1291,6 +1343,11 @@ const InformasiPerusahaan = ({
                       className='form-input'
                       onChange={handleInputChange}
                     />
+                    {chekValid && (
+                      <div className='text-caption-2 text-danger-500 mt-1'>
+                        {errors.bankName}
+                      </div>
+                    )}
                   </div>
                   <div>
                     <input
@@ -1327,16 +1384,6 @@ const InformasiPerusahaan = ({
                     )}
                   </div>
                 </div>
-                {!isKonfirmasi && (
-                  <span className='text-xs opacity-60'>
-                    Isi data bank perusahaan sesuai dengan yang terdaftar
-                  </span>
-                )}
-                {chekValid && (
-                  <div className='text-caption-2 text-danger-500 mt-1'>
-                    {errors.bankName}
-                  </div>
-                )}
               </div>
 
               <div className='flex flex-col gap-2  justify-between items-start'>
@@ -1406,6 +1453,33 @@ const InformasiPerusahaan = ({
                 indoteknik.com
               </div>
               <div className='h-[2px] bg-gray-300 w-[120%] inset-0 relative transform -translate-x-5'></div>
+
+              <div className='flex flex-col gap justify-between items-start'>
+                <label className='form-label  text-wrap '>
+                  Apakah terdapat vendor portal pada perusahaan anda?
+                </label>
+                <div className='flex gap-x-4' ref={bersediaRef}>
+                  <RadioGroup
+                    size='sm'
+                    onChange={handleCheckboxPortalChange}
+                    value={form.portal}
+                  >
+                    <Stack direction='col'>
+                      <Radio colorScheme='red' value='ada'>
+                        Ya, ada
+                      </Radio>
+                      <Radio colorScheme='red' value='tidak'>
+                        Tidak ada
+                      </Radio>
+                    </Stack>
+                  </RadioGroup>
+                </div>
+                {chekValid && (
+                  <div className='text-caption-2 text-danger-500 mt-1'>
+                    {errors.portal}
+                  </div>
+                )}
+              </div>
               <div className='flex flex-col gap justify-between items-start'>
                 <label className='form-label  text-wrap '>
                   Apakah bersedia transaksi via website?
@@ -1428,7 +1502,7 @@ const InformasiPerusahaan = ({
                 </div>
                 {chekValid && (
                   <div className='text-caption-2 text-danger-500 mt-1'>
-                    {errors.estimasi}
+                    {errors.bersedia}
                   </div>
                 )}
               </div>
-- 
cgit v1.2.3

