import { ActiveAccount } from '@components/multiAccounts/activeAccount'; import { InactiveAccount } from '@components/multiAccounts/inactiveAccount'; import { activeAccountAtom } from '@stores/account'; import { APP_VERSION } from '@stores/constants'; import { getAccounts } from '@utils/storage'; import LumeSymbol from '@assets/icons/Lume'; import { PlusIcon } from '@radix-ui/react-icons'; import { useAtomValue } from 'jotai'; import Link from 'next/link'; import { useCallback, useEffect, useState } from 'react'; export default function MultiAccounts() { const activeAccount: any = useAtomValue(activeAccountAtom); const [users, setUsers] = useState([]); const renderAccount = useCallback( (user: { id: string }) => { if (user.id === activeAccount.id) { return ; } else { return ; } }, [activeAccount.id] ); useEffect(() => { const fetchAccount = async () => { const result: any = await getAccounts(); setUsers(result); }; fetchAccount().catch(console.error); }, []); return (
{users.map((user) => renderAccount(user))}
Lume v{APP_VERSION}
); }