import ChatsListItem from "@app/chat/components/item"; import ChatsListSelfItem from "@app/chat/components/self"; import { useActiveAccount } from "@utils/hooks/useActiveAccount"; import { getChats } from "@utils/storage"; import useSWR from "swr"; const fetcher = ([, account]) => getChats(account); export default function ChatsList() { const { account, isLoading, isError } = useActiveAccount(); const { data: chats, error }: any = useSWR( !isLoading && !isError && account ? ["chats", account] : null, fetcher, ); return (
{!chats || error ? ( <>
) : ( chats.map((item: { pubkey: string }) => ( )) )}
); }