import { sessionUser } from '@/auth'; import ChatSidebarList from '@/components/chat-sidebar/ChatListSidebar'; import Loading from '@/components/ui/Loading'; import { dbGetAllChat } from '@/lib/db/functions'; import { Suspense } from 'react'; interface ChatLayoutProps { children: React.ReactNode; } export default async function Layout({ children }: ChatLayoutProps) { const { email, user, id } = await sessionUser(); const chats = await dbGetAllChat(); return (
{user && (
}>
)} }>
{children}
); }