import { ChatModalUser } from '@components/chats/chatModalUser'; import { activeAccountAtom } from '@stores/account'; import * as Dialog from '@radix-ui/react-dialog'; import { Cross1Icon, PlusIcon } from '@radix-ui/react-icons'; import { useAtomValue } from 'jotai'; import { useCallback, useEffect, useState } from 'react'; export const ChatModal = () => { const [plebs, setPlebs] = useState([]); const activeAccount: any = useAtomValue(activeAccountAtom); const fetchPlebsByAccount = useCallback(async (id) => { const { getPlebs } = await import('@utils/bindings'); return await getPlebs({ account_id: id }); }, []); useEffect(() => { fetchPlebsByAccount(activeAccount.id) .then((res) => setPlebs(res)) .catch(console.error); }, [activeAccount.id, fetchPlebsByAccount]); return (
Add a new chat
New chat
{plebs.map((pleb) => ( ))}
); };