From d6ede238658d90315a5dc5b864f20037e8a776f6 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 22 Oct 2024 11:24:43 +0700
Subject: <iman> update & add section dokumen

---
 src/lib/pengajuan-tempo/component/PengajuanTempo.jsx | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

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

diff --git a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
index 2ab7c21a..238c5e4e 100644
--- a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
+++ b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
@@ -5,12 +5,14 @@ import InformasiPerusahaan from './informasiPerusahaan';
 import KontakPerusahaan from './KontakPerusahaan';
 import Pengiriman from './Pengiriman';
 import Referensi from './Referensi';
+import Dokumen from './Dokumen';
 import { Controller, useForm } from 'react-hook-form';
 import {
   usePengajuanTempoStore,
   usePengajuanTempoStoreKontakPerson,
   usePengajuanTempoStorePengiriman,
   usePengajuanTempoStoreSupplier,
+  usePengajuanTempoStoreDokumen,
 } from '../../../../src-migrate/modules/register/stores/usePengajuanTempoStore';
 import { ChevronRightIcon, ChevronLeftIcon } from '@heroicons/react/24/outline';
 const PengajuanTempo = () => {
@@ -18,6 +20,8 @@ const PengajuanTempo = () => {
   const NUMBER_OF_STEPS = 6;
   const { form, errors, validate, updateForm } = usePengajuanTempoStore();
   const { control, watch, setValue } = useForm();
+  const { formDokumen, errorsDokumen, validateDokumen, updateFormDokumen } =
+    usePengajuanTempoStoreDokumen();
   const {
     formKontakPerson,
     errorsKontakPerson,
@@ -45,6 +49,7 @@ const PengajuanTempo = () => {
     />,
     <Pengiriman chekValid={notValid} buttonSubmitClick={buttonSubmitClick} />,
     <Referensi chekValid={notValid} buttonSubmitClick={buttonSubmitClick} />,
+    <Dokumen chekValid={notValid} buttonSubmitClick={buttonSubmitClick} />,
     <div>Dokumen</div>,
     <div>Konfirmasi</div>,
   ];
@@ -53,7 +58,7 @@ const PengajuanTempo = () => {
     errorsKontakPerson,
     errorsPengiriman,
     errorsSupplier,
-    <div>Dokumen</div>,
+    errorsDokumen,
     <div>Konfirmasi</div>,
   ];
   const stepDivsForm = [
@@ -61,7 +66,7 @@ const PengajuanTempo = () => {
     formKontakPerson,
     formPengiriman,
     formSupplier,
-    <div>Dokumen</div>,
+    formDokumen,
     <div>Konfirmasi</div>,
   ];
   const stepDivsUpdateForm = [
@@ -69,7 +74,7 @@ const PengajuanTempo = () => {
     updateFormKontakPerson,
     updateFormPengiriman,
     updateFormSupplier,
-    <div>Dokumen</div>,
+    updateFormDokumen,
     <div>Konfirmasi</div>,
   ];
   const stepLabels = [
@@ -89,6 +94,7 @@ const PengajuanTempo = () => {
     validate();
     validateKontakPerson();
     validatePengiriman();
+    validateDokumen();
 
     window.scrollTo({
       top: 0,
@@ -108,6 +114,8 @@ const PengajuanTempo = () => {
         });
       }
     }
+    if (formSupplier) {
+    }
   }, [currentStep]);
   const goToNextStep = () => {
     if (!isFormValid) {
-- 
cgit v1.2.3

