import Divider from '@/core/components/elements/Divider/Divider'; import AppLayout from '@/core/components/layouts/AppLayout'; import BasicLayout from '@/core/components/layouts/BasicLayout'; import DesktopView from '@/core/components/views/DesktopView'; import MobileView from '@/core/components/views/MobileView'; import useAuth from '@/core/hooks/useAuth'; import CompanyProfile from '@/lib/auth/components/CompanyProfile'; import SwitchAccount from '@/lib/auth/components/SwitchAccount'; import IsAuth from '@/lib/auth/components/IsAuth'; import Menu from '@/lib/auth/components/Menu'; import PersonalProfile from '@/lib/auth/components/PersonalProfile'; import { Button, Checkbox, Spinner, Tooltip } from '@chakra-ui/react'; import { useState, useEffect } from 'react'; import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); const [isAprove, setIsAprove] = useState(false); const handleChange = async () => { setIsChecked(!isChecked); }; useEffect(() => { const loadPromo = async () => { const progresSwitchAccount = await switchAccountProgresApi(); if (progresSwitchAccount) { setIsAprove(true); } console.log('progresSwitchAccount', progresSwitchAccount); }; loadPromo(); }, []); return ( {auth?.parentId && }
{!auth?.parentId && !isAprove && (

Ubah ke akun bisnis

)} {isChecked && (
)} {auth?.parentId && }
); }