From 7647104348478302778c0afbd3a3d1b2637bc03b Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 11 Aug 2025 15:35:25 +0700 Subject: (andri) set true checklist ubah ke akun bisnis --- src/lib/pengajuan-tempo/component/FinishTempo.jsx | 58 +++++++++++++++-------- 1 file changed, 39 insertions(+), 19 deletions(-) (limited to 'src/lib') diff --git a/src/lib/pengajuan-tempo/component/FinishTempo.jsx b/src/lib/pengajuan-tempo/component/FinishTempo.jsx index 84c80e60..9d912b1a 100644 --- a/src/lib/pengajuan-tempo/component/FinishTempo.jsx +++ b/src/lib/pengajuan-tempo/component/FinishTempo.jsx @@ -8,6 +8,7 @@ import useAuth from '@/core/hooks/useAuth'; import axios from 'axios'; import { toast } from 'react-hot-toast'; import { ChevronRightIcon, ChevronLeftIcon } from '@heroicons/react/24/outline'; +import { useRouter } from 'next/router'; const FinishTempo = ({ query }) => { const [data, setData] = useState(); @@ -15,6 +16,8 @@ const FinishTempo = ({ query }) => { const { isDesktop, isMobile } = useDevice(); const auth = useAuth(); const so_order = query?.order_id?.replaceAll('-', '/'); + const router = useRouter(); + useEffect(() => { const fetchData = async () => { const fetchedData = await odooApi( @@ -26,6 +29,14 @@ const FinishTempo = ({ query }) => { fetchData(); }, [query]); + // Handler khusus untuk tombol Ubah Akun + const handleSwitchAccountClick = () => { + // Set flag di localStorage + localStorage.setItem('autoCheckProfile', 'true'); + // Navigate tanpa query param ke halaman profile + router.push('/my/profile'); + }; + return (
{ {query?.status == 'approve' && 'Proses pengajuan tempo anda sudah berhasil terdaftar di indoteknik.com. Nikmati pembelian anda di website indoteknik dengan menggunakan pembayaran tempo'}
- - {query?.status === 'switch-account' - ? 'Ubah Akun' - : query?.status === 'approve' - ? 'Lihat Detail Tempo' - : 'Kembali Ke Beranda'} - - + + {/* Tombol dengan behavior berbeda jika status switch-account */} + {query?.status === 'switch-account' ? ( + + ) : ( + + {query?.status === 'approve' + ? 'Lihat Detail Tempo' + : 'Kembali Ke Beranda'} + + + )} + {/* Video panduan khusus tampil saat status switch-account */} {query?.status === 'switch-account' && ( -
-
+
+

Agar tidak bingung saat mengubah akun,

Yuk pelajari dulu langkah-langkah pengajuan tempo lewat video berikut

-- cgit v1.2.3