import ChatInterface from '../../../components/ChatInterface'; import { auth, sessionUser } from '@/auth'; import { dbGetChat } from '@/lib/db/functions'; import { redirect } from 'next/navigation'; import { revalidatePath } from 'next/cache'; import TopPrompt from '@/components/chat/TopPrompt'; import { Provider } from 'jotai'; interface ChatServerProps { chatId: string; } export default async function ChatServer({ chatId }: ChatServerProps) { const chat = await dbGetChat(chatId); const { id: userId } = await sessionUser(); if (!chat) { revalidatePath('/'); redirect('/'); } return (
); }