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 StatusSwitchAccount from '@/lib/auth/components/StatusSwitchAccount'; import { Checkbox } from '@chakra-ui/react'; import { useState, useEffect } from 'react'; import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; import BottomPopup from '@/core/components/elements/Popup/BottomPopup'; export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); const [ubahAkun, setUbahAkun] = useState(false); const [isAprove, setIsAprove] = useState(); const [changeConfirmation, setChangeConfirmation] = useState(false); const handleChange = async () => { if (isChecked) { setIsChecked(!isChecked); } else { setChangeConfirmation(true); } }; useEffect(() => { const loadPromo = async () => { const progresSwitchAccount = await switchAccountProgresApi(); if (progresSwitchAccount) { setIsAprove(progresSwitchAccount.status); setUbahAkun(progresSwitchAccount.status); } }; loadPromo(); }, []); const handleConfirmSubmit = () => { setChangeConfirmation(false); setIsChecked(true); }; return ( <> setChangeConfirmation(false)} // Menutup popup title='Ubah type akun' > Anda akan mengubah type akun anda? Yakin setChangeConfirmation(false)} > Batal {!auth?.parentId && !ubahAkun && ( Ubah ke akun bisnis )} {isChecked && ( )} {/* {!auth?.parentId ? auth?.parentId : auth?.parent_id && isAprove != 'unknown' && ( )} */} {auth?.parentId && } {!auth?.parentId && !ubahAkun && ( Ubah ke akun bisnis )} {isChecked && ( )} {/* {!auth?.parentId ? auth?.parentId : auth?.parent_id && isAprove != 'unknown' && ( )} */} {auth?.parentId && } > ); }
Ubah ke akun bisnis