diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-28 10:01:30 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-28 10:01:30 +0700 |
| commit | 3eb78e21b89bd0bdddb803767ea6ec983794994b (patch) | |
| tree | f5ced7fe061f1be40bbfbeeb0d4ff1e2b5de5310 /src/lib | |
| parent | 6de06f74f0a004900ecc415b91eb03d1b58a872f (diff) | |
<iman> update temp switch account
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/auth/components/Menu.jsx | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx index 979de83b..042b1842 100644 --- a/src/lib/auth/components/Menu.jsx +++ b/src/lib/auth/components/Menu.jsx @@ -3,20 +3,36 @@ import { useRouter } from 'next/router'; import ImageNext from 'next/image'; import whatsappUrl from '@/core/utils/whatsappUrl'; import useAuth from '@/core/hooks/useAuth'; -import Divider from '@/core/components/elements/Divider/Divider'; +import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; +import { useState, useEffect } from '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); + // } + }; + loadProgres(); + }, []); const routeStartWith = (route) => router.pathname.startsWith(route); return ( <div className='grid grid-cols-1 bg-white border border-gray_r-6 rounded py-2 px-4 sticky top-48'> <div className='flex justify-between py-4'> <div className='font-semibold text-gray_r-12'>Akun Saya</div> - {auth?.company && ( + {auth?.company && !ubahAkun && ( <div className='badge-solid-red mt-1 p-2'>Akun Bisnis</div> )} - {!auth?.company && ( + {ubahAkun && <div className='badge-solid-red mt-1 p-2'>Review</div>} + {!auth?.company && !ubahAkun && ( <div className='badge-gray mt-1 p-2'>Akun Individu</div> )} </div> |
