From fc50a4ebcb3a11dd1059be6282122677499175f7 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Sat, 28 Sep 2024 10:32:53 +0700 Subject: update switch account --- src/lib/auth/components/Menu.jsx | 52 +++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 14 deletions(-) (limited to 'src/lib/auth') diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx index 042b1842..06eb6c2d 100644 --- a/src/lib/auth/components/Menu.jsx +++ b/src/lib/auth/components/Menu.jsx @@ -5,21 +5,18 @@ import whatsappUrl from '@/core/utils/whatsappUrl'; import useAuth from '@/core/hooks/useAuth'; import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; import { useState, useEffect } from 'react'; +import { InfoIcon } from 'lucide-react'; const Menu = () => { const router = useRouter(); const auth = useAuth(); - // console.log('auth', auth); const [ubahAkun, setUbahAkun] = useState(); - // const [isAprove, setIsAprove] = useState(); useEffect(() => { const loadProgres = async () => { const progresSwitchAccount = await switchAccountProgresApi(); - console.log('progresSwitchAccount', progresSwitchAccount); - // if (progresSwitchAccount) { - // setIsAprove(progresSwitchAccount.status); - setUbahAkun(progresSwitchAccount.status); - // } + if (progresSwitchAccount) { + setUbahAkun(progresSwitchAccount.status); + } }; loadProgres(); }, []); @@ -28,13 +25,40 @@ const Menu = () => {
Akun Saya
- {auth?.company && !ubahAkun && ( -
Akun Bisnis
- )} - {ubahAkun &&
Review
} - {!auth?.company && !ubahAkun && ( -
Akun Individu
- )} +
+ {auth?.company && !(ubahAkun === 'pending') && ( + <> +
+

Akun Bisnis

+
+
+ Ini adalah akun bisnis. +
+ + )} + {ubahAkun === 'pending' && ( + <> +
+

Review

+ +
+
+ Akun sedang dalam proses review. +
+ + )} + {!auth?.company && !(ubahAkun === 'pending') && ( + <> +
+

Akun Individu

+ +
+
+ Ini adalah akun individu. +
+ + )} +
Menu
-- cgit v1.2.3