diff options
Diffstat (limited to 'src/lib/pengajuan-tempo/component/FinishTempo.jsx')
| -rw-r--r-- | src/lib/pengajuan-tempo/component/FinishTempo.jsx | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/src/lib/pengajuan-tempo/component/FinishTempo.jsx b/src/lib/pengajuan-tempo/component/FinishTempo.jsx new file mode 100644 index 00000000..bfcd0909 --- /dev/null +++ b/src/lib/pengajuan-tempo/component/FinishTempo.jsx @@ -0,0 +1,112 @@ +import Link from 'next/link'; +import Image from '~/components/ui/image'; +import whatsappUrl from '@/core/utils/whatsappUrl'; +import { useEffect, useState } from 'react'; +import odooApi from '@/core/api/odooApi'; +import useDevice from '@/core/hooks/useDevice'; +import useAuth from '@/core/hooks/useAuth'; +import axios from 'axios'; +import { toast } from 'react-hot-toast'; +import { ChevronRightIcon, ChevronLeftIcon } from '@heroicons/react/24/outline'; + +const FinishTempo = ({ query }) => { + const [data, setData] = useState(); + const [transactionData, setTransactionData] = useState(); + const { isDesktop, isMobile } = useDevice(); + const auth = useAuth(); + const so_order = query?.order_id?.replaceAll('-', '/'); + useEffect(() => { + const fetchData = async () => { + const fetchedData = await odooApi( + 'GET', + `/api/v1/sale_order_number?sale_number=${so_order}` + ); + setData(fetchedData[0]); + }; + fetchData(); + }, [query]); + + return ( + <div className='container flex flex-col items-center gap-4'> + <div + className={`flex ${ + isMobile ? 'w-full' : 'w-2/3' + } justify-center items-center`} + > + <h1 + className={`text-red-500 text-center py-4 font-semibold ${ + isMobile ? 'text-lg' : 'text-3xl' + }`} + > + {query?.status == 'finish' && + 'Form Pengajuan Tempo kamu Telah Berhasil Didaftarkan Mohon menunggu hingga Proses Verifikasi Selesai Dilakukan'} + {query?.status == 'switch-account' && + 'Form Pengajuan Tempo Kamu Gagal Dilakukan'} + {query?.status == 'review' && + 'Pengajuan Tempo dalam Proses Verifikasi'} + {query?.status == 'approve' && 'Pengajuan Tempo Berhasil'} + </h1> + </div> + {query?.status == 'finish' && ( + <Image + src='/images/REGISTRASI-TEMPO.svg' + alt='Registrasi Tempo' + width={isMobile ? 300 : 550} + height={isMobile ? 300 : 550} + /> + )} + {query?.status == 'switch-account' && ( + <Image + src='/images/ICON-TEMPO.png' + alt='Registrasi Tempo' + width={isMobile ? 300 : 550} + height={isMobile ? 300 : 550} + /> + )} + {query?.status == 'review' && ( + <Image + src='/images/ICON-DOKUMEN-VERIFIKASI.png' + alt='Registrasi Tempo' + width={isMobile ? 300 : 550} + height={isMobile ? 300 : 550} + /> + )} + {query?.status == 'approve' && ( + <Image + src='/images/ICON-WEBSITE-TELAH-MENDAFTAR-AKUN-TEMPO.svg' + alt='Registrasi Tempo' + width={isMobile ? 300 : 600} + height={isMobile ? 300 : 550} + /> + )} + + <div + className={`mt-2 text-center opacity-75 leading-6 p-4 md:p-0 ${ + isMobile ? 'w-full text-sm' : 'w-4/5 text-base' + }`} + > + {query?.status == 'switch-account' && + 'Terima kasih atas minat anda untuk mendaftar Tempo, namun sayangnya akun anda bukan merupakan akun bisnis. Segera ubah akun anda menjadi Bisnis untuk menggunakan fitur ini'} + {query?.status == 'finish' && + 'Mohon menunggu untuk verifikasi dokumen dan kelengkapan data yang telah anda berikan. Proses approval pembayaran tempo kamu berhasil atau tidak akan diinfokan melalui email perusahaan / email yang mendaftar'} + {query?.status == 'review' && + 'Proses pengajuan tempo anda saat ini sedang dalam tahapan proses verifikasi oleh tim indoteknik, mohon menunggu'} + {query?.status == 'approve' && + 'Proses pengajuan tempo anda sudah berhasil terdaftar di indoteknik.com. Nikmati pembelian anda di website indoteknik dengan menggunakan pembayaran tempo'} + </div> + <Link + href={query?.status == 'switch-account' ? `/my/profile` : `/my/tempo/`} + className='btn-solid-red rounded-md text-base flex flex-row items-center justify-center' + > + {query?.status == 'switch-account' + ? 'Ubah Akun' + : query?.status == 'approve' + ? 'Lihat Detail Tempo' + : 'Lihat Status Pendaftaran'} + <ChevronRightIcon className='w-5' /> + </Link> + </div> + ); +}; + +export default FinishTempo; |
