From dde82979c57ab0261a802ab4134e65272e3d4a37 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 16 Jan 2025 08:51:26 +0700 Subject: update merchant --- src/lib/merchant/components/Konfirmasi.jsx | 297 +++++++++++++++++++++++++++++ 1 file changed, 297 insertions(+) create mode 100644 src/lib/merchant/components/Konfirmasi.jsx (limited to 'src/lib/merchant/components/Konfirmasi.jsx') diff --git a/src/lib/merchant/components/Konfirmasi.jsx b/src/lib/merchant/components/Konfirmasi.jsx new file mode 100644 index 00000000..6372f156 --- /dev/null +++ b/src/lib/merchant/components/Konfirmasi.jsx @@ -0,0 +1,297 @@ +import React, { useState, useEffect, useMemo, useRef } from 'react'; +import { Controller, set, useForm } from 'react-hook-form'; +import HookFormSelect from '@/core/components/elements/Select/HookFormSelect'; +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'; +import InformasiPerusahaan from './InformasiPerusahaan'; +import Pengiriman from './Pengiriman'; +import KonfirmasiDokumen from './KonfirmasiDokumen'; +import useDevice from '@/core/hooks/useDevice'; +import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'; +const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { + const { control, watch, setValue, getValues } = useForm(); + const { isDesktop, isMobile } = useDevice(); + const [isOpenInformasi, setIsOpenInformasi] = useState(true); + const [isOpenKontak, setIsOpenKontak] = useState(false); + const [isOpenPengiriman, setIsOpenPengiriman] = useState(false); + const [isOpenKonfirmasi, setIsOpenKonfirmasi] = useState(false); + const [industries, setIndustries] = useState([]); + const { + formDokumen, + errorsDokumen, + validateDokumen, + updateFormDokumen, + getJumlahDokumenDiisi, + } = usePengajuanTempoStoreDokumen(); + const { form, errors, validate, updateForm } = usePengajuanTempoStore(); + const handleInputChange = async (event) => { + let fileBase64 = ''; + const { name } = event.target; + const file = event.target.files?.[0]; + // Allowed file extensions + const allowedExtensions = ['pdf', 'png', 'jpg', 'jpeg']; + let fileExtension = ''; + if (file) { + fileExtension = file.name.split('.').pop()?.toLowerCase(); + + if (!fileExtension || !allowedExtensions.includes(fileExtension)) { + toast.error( + 'Format file yang diijinkan adalah .pdf, .png, .jpg, atau .jpeg', + { duration: 4000 } + ); + + event.target.value = ''; + return; + } + if (file.size > 2000000) { + toast.error('Maksimal ukuran file adalah 2MB', { duration: 4000 }); + + event.target.value = ''; + return; + } + + fileBase64 = await getFileBase64(file); + updateFormDokumen(name, file.name, fileExtension, fileBase64); + validateDokumen(); + } + }; + + const isFormValid = useMemo( + () => Object.keys(errorsDokumen).length === 0, + [errorsDokumen] + ); + const dokumenNibRef = useRef(null); + const dokumenNpwpRef = useRef(null); + const dokumenSppkpRef = useRef(null); + const dokumenAktaPerubahanRef = useRef(null); + const dokumenKtpDirutRef = useRef(null); + const dokumenAktaPendirianRef = useRef(null); + const dokumenLaporanKeuanganRef = useRef(null); + const dokumenFotoKantorRef = useRef(null); + const dokumenTempatBekerjaRef = useRef(null); + + useEffect(() => { + const loadIndustries = async () => { + if (!isFormValid) { + const options = { + behavior: 'smooth', + block: 'center', + }; + if (errorsDokumen.dokumenNib && dokumenNibRef.current) { + dokumenNibRef.current.scrollIntoView(options); + return; + } + if (errorsDokumen.dokumenNpwp && dokumenNpwpRef.current) { + dokumenNpwpRef.current.scrollIntoView(options); + return; + } + if (errorsDokumen.dokumenSppkp && dokumenSppkpRef.current) { + dokumenSppkpRef.current.scrollIntoView(options); + return; + } + if ( + errorsDokumen.dokumenAktaPerubahan && + dokumenAktaPerubahanRef.current + ) { + dokumenAktaPerubahanRef.current.scrollIntoView(options); + return; + } + if (errorsDokumen.dokumenKtpDirut && dokumenKtpDirutRef.current) { + dokumenKtpDirutRef.current.scrollIntoView(options); + return; + } + if ( + errorsDokumen.dokumenAktaPendirian && + dokumenAktaPendirianRef.current + ) { + dokumenAktaPendirianRef.current.scrollIntoView(options); + return; + } + if ( + errorsDokumen.dokumenLaporanKeuangan && + dokumenLaporanKeuanganRef.current + ) { + dokumenLaporanKeuanganRef.current.scrollIntoView(options); + return; + } + if (errorsDokumen.dokumenFotoKantor && dokumenFotoKantorRef.current) { + dokumenFotoKantorRef.current.scrollIntoView(options); + return; + } + if ( + errorsDokumen.dokumenTempatBekerja && + dokumenTempatBekerjaRef.current + ) { + dokumenTempatBekerjaRef.current.scrollIntoView(options); + return; + } + } + }; + loadIndustries(); + }, [buttonSubmitClick, chekValid]); + + useEffect(() => { + validateDokumen(); + }, [buttonSubmitClick]); + + useEffect(() => { + const loadIndustries = async () => { + const dataIndustries = await odooApi('GET', '/api/v1/partner/industry'); + setIndustries( + dataIndustries?.map((o) => ({ + value: o.id, + label: o.name, + category: o.category, + })) + ); + }; + loadIndustries(); + }, []); + + useEffect(() => { + const selectedIndustryType = industries.find( + (industry) => industry.value === watch('industry_id') + ); + if (selectedIndustryType) { + updateForm('industry_id', `${selectedIndustryType?.value}`); + validate(); + } + }, [watch('industry_id'), industries]); + + useEffect(() => { + if (form.industry_id) { + setValue('industry_id', parseInt(form.industry_id)); + } + }, [form]); + + return ( + <> + {isDesktop && ( +
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+ )} + {isMobile && ( +
+
+
+
+

Informasi Perusahaan

+ + Pastikan informasi usaha yang anda masukkan sudah sesuai + dengan data perusahaan anda + +
+
+ {isOpenInformasi ? ( + setIsOpenInformasi(!isOpenInformasi)} + /> + ) : ( + setIsOpenInformasi(!isOpenInformasi)} + /> + )} +
+
+ {isOpenInformasi && } +
+
+
+
+

Kontak Person

+
+ {isOpenKontak ? ( + setIsOpenKontak(!isOpenKontak)} + /> + ) : ( + setIsOpenKontak(!isOpenKontak)} + /> + )} +
+
+ {isOpenKontak && } +
+
+
+
+

Pengiriman

+
+ {isOpenPengiriman ? ( + setIsOpenPengiriman(!isOpenPengiriman)} + /> + ) : ( + setIsOpenPengiriman(!isOpenPengiriman)} + /> + )} +
+
+ {isOpenPengiriman && } +
+
+
+
+

Dokumen

+
+ {isOpenKonfirmasi ? ( + setIsOpenKonfirmasi(!isOpenKonfirmasi)} + /> + ) : ( + setIsOpenKonfirmasi(!isOpenKonfirmasi)} + /> + )} +
+
+ {isOpenKonfirmasi && } +
+
+ )} + + ); +}; + +export default Konfirmasi; -- cgit v1.2.3 From cb083185ce59df7143ea258e147a118a1e416e56 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 20 Jan 2025 10:33:19 +0700 Subject: update merchant --- src/lib/merchant/components/Konfirmasi.jsx | 252 +++++++++-------------------- 1 file changed, 77 insertions(+), 175 deletions(-) (limited to 'src/lib/merchant/components/Konfirmasi.jsx') diff --git a/src/lib/merchant/components/Konfirmasi.jsx b/src/lib/merchant/components/Konfirmasi.jsx index 6372f156..45db7388 100644 --- a/src/lib/merchant/components/Konfirmasi.jsx +++ b/src/lib/merchant/components/Konfirmasi.jsx @@ -1,207 +1,109 @@ import React, { useState, useEffect, useMemo, useRef } from 'react'; import { Controller, set, useForm } from 'react-hook-form'; import HookFormSelect from '@/core/components/elements/Select/HookFormSelect'; +// import ProgressBar from '@ramonak/react-progress-bar'; 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'; + Button, + Checkbox, + Spinner, + Tooltip, + 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'; import InformasiPerusahaan from './InformasiPerusahaan'; -import Pengiriman from './Pengiriman'; -import KonfirmasiDokumen from './KonfirmasiDokumen'; +import InformasiVendor from './InformasiVendor'; +import SyaratDagang from './SyaratDagang'; +import Dokumen from './Dokumen'; import useDevice from '@/core/hooks/useDevice'; import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'; +import { useRouter } from 'next/router'; const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { - const { control, watch, setValue, getValues } = useForm(); + const { control, watch, setValue, getValues, reset } = useForm(); const { isDesktop, isMobile } = useDevice(); const [isOpenInformasi, setIsOpenInformasi] = useState(true); const [isOpenKontak, setIsOpenKontak] = useState(false); const [isOpenPengiriman, setIsOpenPengiriman] = useState(false); const [isOpenKonfirmasi, setIsOpenKonfirmasi] = useState(false); - const [industries, setIndustries] = useState([]); - const { - formDokumen, - errorsDokumen, - validateDokumen, - updateFormDokumen, - getJumlahDokumenDiisi, - } = usePengajuanTempoStoreDokumen(); - const { form, errors, validate, updateForm } = usePengajuanTempoStore(); - const handleInputChange = async (event) => { - let fileBase64 = ''; - const { name } = event.target; - const file = event.target.files?.[0]; - // Allowed file extensions - const allowedExtensions = ['pdf', 'png', 'jpg', 'jpeg']; - let fileExtension = ''; - if (file) { - fileExtension = file.name.split('.').pop()?.toLowerCase(); - - if (!fileExtension || !allowedExtensions.includes(fileExtension)) { - toast.error( - 'Format file yang diijinkan adalah .pdf, .png, .jpg, atau .jpeg', - { duration: 4000 } - ); - - event.target.value = ''; - return; - } - if (file.size > 2000000) { - toast.error('Maksimal ukuran file adalah 2MB', { duration: 4000 }); - - event.target.value = ''; - return; - } - - fileBase64 = await getFileBase64(file); - updateFormDokumen(name, file.name, fileExtension, fileBase64); - validateDokumen(); + const formRef = useRef(null); + const router = useRouter(); + const handleDaftarMerchant = () => { + if (formRef.current) { + formRef.current(); // Memicu submit form di InformasiPerusahaan } }; - - const isFormValid = useMemo( - () => Object.keys(errorsDokumen).length === 0, - [errorsDokumen] - ); - const dokumenNibRef = useRef(null); - const dokumenNpwpRef = useRef(null); - const dokumenSppkpRef = useRef(null); - const dokumenAktaPerubahanRef = useRef(null); - const dokumenKtpDirutRef = useRef(null); - const dokumenAktaPendirianRef = useRef(null); - const dokumenLaporanKeuanganRef = useRef(null); - const dokumenFotoKantorRef = useRef(null); - const dokumenTempatBekerjaRef = useRef(null); - - useEffect(() => { - const loadIndustries = async () => { - if (!isFormValid) { - const options = { - behavior: 'smooth', - block: 'center', - }; - if (errorsDokumen.dokumenNib && dokumenNibRef.current) { - dokumenNibRef.current.scrollIntoView(options); - return; - } - if (errorsDokumen.dokumenNpwp && dokumenNpwpRef.current) { - dokumenNpwpRef.current.scrollIntoView(options); - return; - } - if (errorsDokumen.dokumenSppkp && dokumenSppkpRef.current) { - dokumenSppkpRef.current.scrollIntoView(options); - return; - } - if ( - errorsDokumen.dokumenAktaPerubahan && - dokumenAktaPerubahanRef.current - ) { - dokumenAktaPerubahanRef.current.scrollIntoView(options); - return; - } - if (errorsDokumen.dokumenKtpDirut && dokumenKtpDirutRef.current) { - dokumenKtpDirutRef.current.scrollIntoView(options); - return; - } - if ( - errorsDokumen.dokumenAktaPendirian && - dokumenAktaPendirianRef.current - ) { - dokumenAktaPendirianRef.current.scrollIntoView(options); - return; - } - if ( - errorsDokumen.dokumenLaporanKeuangan && - dokumenLaporanKeuanganRef.current - ) { - dokumenLaporanKeuanganRef.current.scrollIntoView(options); - return; - } - if (errorsDokumen.dokumenFotoKantor && dokumenFotoKantorRef.current) { - dokumenFotoKantorRef.current.scrollIntoView(options); - return; - } - if ( - errorsDokumen.dokumenTempatBekerja && - dokumenTempatBekerjaRef.current - ) { - dokumenTempatBekerjaRef.current.scrollIntoView(options); - return; - } - } - }; - loadIndustries(); - }, [buttonSubmitClick, chekValid]); - - useEffect(() => { - validateDokumen(); - }, [buttonSubmitClick]); - - useEffect(() => { - const loadIndustries = async () => { - const dataIndustries = await odooApi('GET', '/api/v1/partner/industry'); - setIndustries( - dataIndustries?.map((o) => ({ - value: o.id, - label: o.name, - category: o.category, - })) - ); - }; - loadIndustries(); - }, []); - - useEffect(() => { - const selectedIndustryType = industries.find( - (industry) => industry.value === watch('industry_id') - ); - if (selectedIndustryType) { - updateForm('industry_id', `${selectedIndustryType?.value}`); - validate(); + const handleIsError = (value) => { + console.log('LAHKAH SELANJUTNYA', value); + if (!value) { + // goToNextStep(); + toast.success('Berhasil medaftarkan merchant'); } - }, [watch('industry_id'), industries]); + reset(); + router.push('/'); + }; - useEffect(() => { - if (form.industry_id) { - setValue('industry_id', parseInt(form.industry_id)); - } - }, [form]); - return ( <> {isDesktop && ( -
-
-
-
- -
-
-
- + <> + +
+
+
+ +
+
+
+ +
-
-
-
-
- -
-
-
- +
+
+
+ +
+
+
+ +
+ + +
+ + *Pastikan data yang anda masukan sudah benar dan sesuai + +
- + )} - {isMobile && ( + {/* {isMobile && (
@@ -289,7 +191,7 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { {isOpenKonfirmasi && }
- )} + )} */} ); }; -- cgit v1.2.3 From 898c82a908d604862596e477bd66ecc15fe3af0c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 21 Jan 2025 16:34:44 +0700 Subject: update merchant --- src/lib/merchant/components/Konfirmasi.jsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/lib/merchant/components/Konfirmasi.jsx') diff --git a/src/lib/merchant/components/Konfirmasi.jsx b/src/lib/merchant/components/Konfirmasi.jsx index 45db7388..6deabe05 100644 --- a/src/lib/merchant/components/Konfirmasi.jsx +++ b/src/lib/merchant/components/Konfirmasi.jsx @@ -17,6 +17,7 @@ import InformasiPerusahaan from './InformasiPerusahaan'; import InformasiVendor from './InformasiVendor'; import SyaratDagang from './SyaratDagang'; import Dokumen from './Dokumen'; +import createMerchantApi from '../api/createMerchantApi'; import useDevice from '@/core/hooks/useDevice'; import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'; import { useRouter } from 'next/router'; @@ -34,11 +35,24 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { formRef.current(); // Memicu submit form di InformasiPerusahaan } }; - const handleIsError = (value) => { + const handleIsError = async (value) => { console.log('LAHKAH SELANJUTNYA', value); if (!value) { // goToNextStep(); - toast.success('Berhasil medaftarkan merchant'); + const toastId = toast.loading('Mengirimkan formulir merchant...'); + const data = { + merchant_request: true, + }; + const create_leads = await createMerchantApi({ data }); + if (create_leads) { + toast.dismiss(toastId); + toast.success('Berhasil medaftarkan merchant'); + reset(); + // router.push('/+'); + } else { + toast.dismiss(toastId); + toast.error('Gagal menambahkan data'); + } } reset(); router.push('/'); -- cgit v1.2.3 From 238c675eecaf6f4f953d87c4b0a128bfa139cff4 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 22 Jan 2025 10:06:37 +0700 Subject: update merchant --- src/lib/merchant/components/Konfirmasi.jsx | 31 ++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'src/lib/merchant/components/Konfirmasi.jsx') diff --git a/src/lib/merchant/components/Konfirmasi.jsx b/src/lib/merchant/components/Konfirmasi.jsx index 6deabe05..9556c88a 100644 --- a/src/lib/merchant/components/Konfirmasi.jsx +++ b/src/lib/merchant/components/Konfirmasi.jsx @@ -36,7 +36,6 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { } }; const handleIsError = async (value) => { - console.log('LAHKAH SELANJUTNYA', value); if (!value) { // goToNextStep(); const toastId = toast.loading('Mengirimkan formulir merchant...'); @@ -117,16 +116,16 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => {
)} - {/* {isMobile && ( + {isMobile && (

Informasi Perusahaan

- + {/* Pastikan informasi usaha yang anda masukkan sudah sesuai dengan data perusahaan anda - + */}
{isOpenInformasi ? ( @@ -147,7 +146,7 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => {
-

Kontak Person

+

Informasi Vendor

{isOpenKontak ? ( { )}
- {isOpenKontak && } + {isOpenKontak && }
-

Pengiriman

+

Syarat Perdagangan

{isOpenPengiriman ? ( { )}
- {isOpenPengiriman && } + {isOpenPengiriman && }
@@ -202,10 +201,22 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { )}
- {isOpenKonfirmasi && } + {isOpenKonfirmasi && } +
+
+ + *Pastikan data yang anda masukan sudah benar dan sesuai + +
- )} */} + )} ); }; -- cgit v1.2.3 From 5eed16f154dee8e72d9ac55ff5eb8a958e0e6db1 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 16 May 2025 08:44:23 +0700 Subject: Form Merchant --- src/lib/merchant/components/Konfirmasi.jsx | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'src/lib/merchant/components/Konfirmasi.jsx') diff --git a/src/lib/merchant/components/Konfirmasi.jsx b/src/lib/merchant/components/Konfirmasi.jsx index 9556c88a..ac5cb27b 100644 --- a/src/lib/merchant/components/Konfirmasi.jsx +++ b/src/lib/merchant/components/Konfirmasi.jsx @@ -90,14 +90,6 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { handleIsError={handleIsError} />
-
-
- -
@@ -184,25 +176,7 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { {isOpenPengiriman && }
-
-
-

Dokumen

-
- {isOpenKonfirmasi ? ( - setIsOpenKonfirmasi(!isOpenKonfirmasi)} - /> - ) : ( - setIsOpenKonfirmasi(!isOpenKonfirmasi)} - /> - )} -
-
- {isOpenKonfirmasi && } -
+
*Pastikan data yang anda masukan sudah benar dan sesuai -- cgit v1.2.3 From 0a5e12b03eee0f559a19f7dce861161ff2ce5a49 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 23 May 2025 11:13:33 +0700 Subject: Revert "Form Merchant" This reverts commit 5eed16f154dee8e72d9ac55ff5eb8a958e0e6db1. --- src/lib/merchant/components/Konfirmasi.jsx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/lib/merchant/components/Konfirmasi.jsx') diff --git a/src/lib/merchant/components/Konfirmasi.jsx b/src/lib/merchant/components/Konfirmasi.jsx index ac5cb27b..9556c88a 100644 --- a/src/lib/merchant/components/Konfirmasi.jsx +++ b/src/lib/merchant/components/Konfirmasi.jsx @@ -90,6 +90,14 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { handleIsError={handleIsError} />
+
+
+ +
@@ -176,7 +184,25 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { {isOpenPengiriman && }
- +
+
+

Dokumen

+
+ {isOpenKonfirmasi ? ( + setIsOpenKonfirmasi(!isOpenKonfirmasi)} + /> + ) : ( + setIsOpenKonfirmasi(!isOpenKonfirmasi)} + /> + )} +
+
+ {isOpenKonfirmasi && } +
*Pastikan data yang anda masukan sudah benar dan sesuai -- cgit v1.2.3 From fd867a90e22fb2fc2fb16237165796ebe0cabab0 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 27 May 2025 08:29:22 +0700 Subject: off site merchant --- src/lib/merchant/components/Konfirmasi.jsx | 440 ++++++++++++++--------------- 1 file changed, 220 insertions(+), 220 deletions(-) (limited to 'src/lib/merchant/components/Konfirmasi.jsx') diff --git a/src/lib/merchant/components/Konfirmasi.jsx b/src/lib/merchant/components/Konfirmasi.jsx index 9556c88a..f7d552ac 100644 --- a/src/lib/merchant/components/Konfirmasi.jsx +++ b/src/lib/merchant/components/Konfirmasi.jsx @@ -1,224 +1,224 @@ -import React, { useState, useEffect, useMemo, useRef } from 'react'; -import { Controller, set, useForm } from 'react-hook-form'; -import HookFormSelect from '@/core/components/elements/Select/HookFormSelect'; -// import ProgressBar from '@ramonak/react-progress-bar'; -import { - Button, - Checkbox, - Spinner, - Tooltip, - 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'; -import InformasiPerusahaan from './InformasiPerusahaan'; -import InformasiVendor from './InformasiVendor'; -import SyaratDagang from './SyaratDagang'; -import Dokumen from './Dokumen'; -import createMerchantApi from '../api/createMerchantApi'; -import useDevice from '@/core/hooks/useDevice'; -import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'; -import { useRouter } from 'next/router'; -const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { - const { control, watch, setValue, getValues, reset } = useForm(); - const { isDesktop, isMobile } = useDevice(); - const [isOpenInformasi, setIsOpenInformasi] = useState(true); - const [isOpenKontak, setIsOpenKontak] = useState(false); - const [isOpenPengiriman, setIsOpenPengiriman] = useState(false); - const [isOpenKonfirmasi, setIsOpenKonfirmasi] = useState(false); - const formRef = useRef(null); - const router = useRouter(); - const handleDaftarMerchant = () => { - if (formRef.current) { - formRef.current(); // Memicu submit form di InformasiPerusahaan - } - }; - const handleIsError = async (value) => { - if (!value) { - // goToNextStep(); - const toastId = toast.loading('Mengirimkan formulir merchant...'); - const data = { - merchant_request: true, - }; - const create_leads = await createMerchantApi({ data }); - if (create_leads) { - toast.dismiss(toastId); - toast.success('Berhasil medaftarkan merchant'); - reset(); - // router.push('/+'); - } else { - toast.dismiss(toastId); - toast.error('Gagal menambahkan data'); - } - } - reset(); - router.push('/'); - }; +// import React, { useState, useEffect, useMemo, useRef } from 'react'; +// import { Controller, set, useForm } from 'react-hook-form'; +// import HookFormSelect from '@/core/components/elements/Select/HookFormSelect'; +// // import ProgressBar from '@ramonak/react-progress-bar'; +// import { +// Button, +// Checkbox, +// Spinner, +// Tooltip, +// 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'; +// import InformasiPerusahaan from './InformasiPerusahaan'; +// import InformasiVendor from './InformasiVendor'; +// import SyaratDagang from './SyaratDagang'; +// import Dokumen from './Dokumen'; +// import createMerchantApi from '../api/createMerchantApi'; +// import useDevice from '@/core/hooks/useDevice'; +// import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'; +// import { useRouter } from 'next/router'; +// const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { +// const { control, watch, setValue, getValues, reset } = useForm(); +// const { isDesktop, isMobile } = useDevice(); +// const [isOpenInformasi, setIsOpenInformasi] = useState(true); +// const [isOpenKontak, setIsOpenKontak] = useState(false); +// const [isOpenPengiriman, setIsOpenPengiriman] = useState(false); +// const [isOpenKonfirmasi, setIsOpenKonfirmasi] = useState(false); +// const formRef = useRef(null); +// const router = useRouter(); +// const handleDaftarMerchant = () => { +// if (formRef.current) { +// formRef.current(); // Memicu submit form di InformasiPerusahaan +// } +// }; +// const handleIsError = async (value) => { +// if (!value) { +// // goToNextStep(); +// const toastId = toast.loading('Mengirimkan formulir merchant...'); +// const data = { +// merchant_request: true, +// }; +// const create_leads = await createMerchantApi({ data }); +// if (create_leads) { +// toast.dismiss(toastId); +// toast.success('Berhasil medaftarkan merchant'); +// reset(); +// // router.push('/+'); +// } else { +// toast.dismiss(toastId); +// toast.error('Gagal menambahkan data'); +// } +// } +// reset(); +// router.push('/'); +// }; - return ( - <> - {isDesktop && ( - <> -
-
-
-
- -
-
-
- -
-
+// return ( +// <> +// {isDesktop && ( +// <> +// +//
+//
+//
+// +//
+//
+//
+// +//
+//
-
-
-
- -
-
-
- -
-
-
- +//
+//
+//
+// +//
+//
+//
+// +//
+//
+//
+// -
- - *Pastikan data yang anda masukan sudah benar dan sesuai - - -
- - )} - {isMobile && ( -
-
-
-
-

Informasi Perusahaan

- {/* - Pastikan informasi usaha yang anda masukkan sudah sesuai - dengan data perusahaan anda - */} -
-
- {isOpenInformasi ? ( - setIsOpenInformasi(!isOpenInformasi)} - /> - ) : ( - setIsOpenInformasi(!isOpenInformasi)} - /> - )} -
-
- {isOpenInformasi && } -
-
-
-
-

Informasi Vendor

-
- {isOpenKontak ? ( - setIsOpenKontak(!isOpenKontak)} - /> - ) : ( - setIsOpenKontak(!isOpenKontak)} - /> - )} -
-
- {isOpenKontak && } -
-
-
-
-

Syarat Perdagangan

-
- {isOpenPengiriman ? ( - setIsOpenPengiriman(!isOpenPengiriman)} - /> - ) : ( - setIsOpenPengiriman(!isOpenPengiriman)} - /> - )} -
-
- {isOpenPengiriman && } -
-
-
-
-

Dokumen

-
- {isOpenKonfirmasi ? ( - setIsOpenKonfirmasi(!isOpenKonfirmasi)} - /> - ) : ( - setIsOpenKonfirmasi(!isOpenKonfirmasi)} - /> - )} -
-
- {isOpenKonfirmasi && } -
-
- - *Pastikan data yang anda masukan sudah benar dan sesuai - - -
-
- )} - - ); -}; +//
+// +// *Pastikan data yang anda masukan sudah benar dan sesuai +// +// +//
+// +// )} +// {isMobile && ( +//
+//
+//
+//
+//

Informasi Perusahaan

+// {/* +// Pastikan informasi usaha yang anda masukkan sudah sesuai +// dengan data perusahaan anda +// */} +//
+//
+// {isOpenInformasi ? ( +// setIsOpenInformasi(!isOpenInformasi)} +// /> +// ) : ( +// setIsOpenInformasi(!isOpenInformasi)} +// /> +// )} +//
+//
+// {isOpenInformasi && } +//
+//
+//
+//
+//

Informasi Vendor

+//
+// {isOpenKontak ? ( +// setIsOpenKontak(!isOpenKontak)} +// /> +// ) : ( +// setIsOpenKontak(!isOpenKontak)} +// /> +// )} +//
+//
+// {isOpenKontak && } +//
+//
+//
+//
+//

Syarat Perdagangan

+//
+// {isOpenPengiriman ? ( +// setIsOpenPengiriman(!isOpenPengiriman)} +// /> +// ) : ( +// setIsOpenPengiriman(!isOpenPengiriman)} +// /> +// )} +//
+//
+// {isOpenPengiriman && } +//
+//
+//
+//
+//

Dokumen

+//
+// {isOpenKonfirmasi ? ( +// setIsOpenKonfirmasi(!isOpenKonfirmasi)} +// /> +// ) : ( +// setIsOpenKonfirmasi(!isOpenKonfirmasi)} +// /> +// )} +//
+//
+// {isOpenKonfirmasi && } +//
+//
+// +// *Pastikan data yang anda masukan sudah benar dan sesuai +// +// +//
+//
+// )} +// +// ); +// }; -export default Konfirmasi; +// export default Konfirmasi; -- cgit v1.2.3