summaryrefslogtreecommitdiff
path: root/src/lib/merchant/components
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-01-22 10:10:19 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-01-22 10:10:19 +0700
commit5cc3c938da3dfde636b918b8f2fdef33f3c61419 (patch)
tree222177fe6dce70fc608698c700de17032105998a /src/lib/merchant/components
parent238c675eecaf6f4f953d87c4b0a128bfa139cff4 (diff)
parent6d9c1067b6e857eb95f12864cc88117350ae6cfb (diff)
Merge branch 'new-release' into CR/form-merchant
# Conflicts: # src/lib/form/components/Merchant.jsx
Diffstat (limited to 'src/lib/merchant/components')
-rw-r--r--src/lib/merchant/components/Merchant.jsx155
1 files changed, 1 insertions, 154 deletions
diff --git a/src/lib/merchant/components/Merchant.jsx b/src/lib/merchant/components/Merchant.jsx
index a92619b6..3c16e3ba 100644
--- a/src/lib/merchant/components/Merchant.jsx
+++ b/src/lib/merchant/components/Merchant.jsx
@@ -81,111 +81,13 @@ const Merchant = () => {
<InformasiPerusahaan buttonSubmitClick={buttonSubmitClick} />;
}, [buttonSubmitClick]);
- // useEffect(() => {
- // const loadBigData = async () => {
- // const toCamelCase = (str) =>
- // str.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
-
- // const transformKeysToCamelCase = (data) => {
- // if (Array.isArray(data)) {
- // return data.map((item) => transformKeysToCamelCase(item));
- // } else if (data && typeof data === 'object') {
- // return Object.keys(data).reduce((acc, key) => {
- // const camelKey = toCamelCase(key); // Ubah kunci menjadi camelCase
- // acc[camelKey] = transformKeysToCamelCase(data[key]); // Rekursif untuk nested object atau array
- // return acc;
- // }, {});
- // }
- // return data; // Jika bukan object atau array, kembalikan nilai aslinya
- // };
-
- // try {
- // const dataPaymentTerm = await odooApi(
- // 'GET',
- // `/api/v1/partner/detail-tempo/${auth.parentId}`
- // );
- // const transformedData = transformKeysToCamelCase(dataPaymentTerm);
- // setBigData(transformedData);
- // } catch (error) {
- // console.error('Error loading dataPaymentTerm:', error);
- // }
- // };
-
- // loadBigData();
- // }, [auth]);
-
- // useEffect(() => {
- // const cachedData = bigData;
-
- // const loadBigData = async () => {
- // if (cachedData) {
- // // Ambil kunci-kunci yang relevan berdasarkan currentStep dari stepDivsForm
- // const formKeys = stepDivsForm[currentStep]
- // ? Object.keys(stepDivsForm[currentStep])
- // : [];
- // if (currentStep === 3) {
- // stepDivsUpdateForm[currentStep](cachedData.supplierIds);
- // } else if (currentStep === 4) {
- // formKeys.forEach((key) => {
- // if (cachedData[key]) {
- // // Proses hanya kunci yang ada di cachedData
- // const { name, format, base64 } = cachedData[key];
- // stepDivsUpdateForm[currentStep](key, name, format, base64);
- // }
- // });
- // } else {
- // formKeys.forEach((key) => {
- // if (bigData[key]) {
- // // Ubah data menjadi string
- // const stringData =
- // typeof bigData[key] === 'object'
- // ? JSON.stringify(bigData[key]) // Untuk objek atau array
- // : String(bigData[key]); // Untuk tipe primitif
- // // Kirim data yang sudah diubah ke string ke stepDivsUpdateForm
- // stepDivsUpdateForm[currentStep](key, stringData);
- // }
- // });
- // }
- // }
- // };
- // loadBigData();
- // validate();
- // validateKontakPerson();
- // validatePengiriman();
- // validateDokumen();
- // validateSupplier();
- // updateHasSave(true);
- // }, [currentStep, bigData, auth]);
-
const goToNextStep = () => {
- // if (!isFormValid) {
- // setNotValid(true);
- // setButtonSubmitClick(!buttonSubmitClick);
- // return;
- // } else {
- // // saveToLocalStorage(stepLabels[currentStep], stepDivsForm[currentStep]);
- // if (currentStep == 3) {
- // handleDaftarTempoSupplier();
- // } else if (currentStep == 4) {
- // handleDaftarTempoDokumen();
- // } else {
- // handleDaftarTempoPerPage(
- // stepLabels[currentStep],
- // stepDivsForm[currentStep]
- // );
- // }
- // setButtonSubmitClick(!buttonSubmitClick);
- // setNotValid(false);
- // }
setCurrentStep((prev) => (prev === NUMBER_OF_STEPS - 1 ? prev : prev + 1));
};
const goPrevStep = () => {
setCurrentStep((prev) => (prev === NUMBER_OF_STEPS - 1 ? prev : prev - 1));
};
- const handleDaftarMerchant = () => {
- setButtonSubmitClick((prev) => !prev);
- };
useEffect(() => {
const getBanner = async () => {
@@ -236,62 +138,7 @@ const Merchant = () => {
? 'flex-col justify-start items-start'
: 'flex-col justify-end items-end'
} mb-8 gap-2`}
- >
- {/* <span className='text-xs opacity-60'>
- *Pastikan data yang anda masukan sudah benar dan sesuai
- </span> */}
- {/* <div
- className={` flex flex-row ${
- currentStep > 0 && currentStep < 5
- ? 'justify-between'
- : 'justify-end'
- } items-center w-full ${isMobile ? 'gap-x-4 ' : ''}`}
- >
- {currentStep < 5 && currentStep > 0 && (
- <Button
- colorScheme='yellow'
- w={`${isMobile ? 'full' : 'fit'}`}
- onClick={goPrevStep}
- >
- {<ChevronLeftIcon className='w-5' />}
- <span className={`font-medium ${isMobile ? 'text-xs' : ''} `}>
- Langkah Sebelumnya
- </span>
- </Button>
- )}
- {currentStep < 5 && (
- <>
- <Button
- colorScheme='red'
- w={`${isMobile ? 'full' : 'fit'}`}
- isDisabled={currentStep === NUMBER_OF_STEPS - 1}
- onClick={goToNextStep}
- >
- <span className={`${isMobile ? 'text-xs' : ''} `}>
- Langkah Selanjutnya
- </span>
- {<ChevronRightIcon className='w-5' />}
- </Button>
- </>
- )}
- </div> */}
- {/* {currentStep == 0 && (
- <div
- className={`flex flex-col ${
- isMobile ? 'items-start' : 'items-end'
- } w-full justify-start gap-4`}
- >
- <Button
- colorScheme='red'
- w={`${isMobile ? 'full' : '36'}`}
- // isDisabled={!isCheckedTNC}
- onClick={handleDaftarMerchant}
- >
- Daftar Merchant {<ChevronRightIcon className='w-5' />}
- </Button>
- </div>
- )} */}
- </div>
+ ></div>
</div>
</>
);