Spaces:
Sleeping
Sleeping
File size: 460 Bytes
1f931d5 009c95b 1f931d5 009c95b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import ChatClient from './ChatClient';
import { auth } from '@/auth';
import { dbGetChat } from '@/lib/db/functions';
import { redirect } from 'next/navigation';
import { revalidatePath } from 'next/cache';
interface ChatServerProps {
id: string;
}
export default async function ChatServer({ id }: ChatServerProps) {
const chat = await dbGetChat(id);
if (!chat) {
revalidatePath('/');
redirect('/');
}
return <ChatClient chat={chat} />;
}
|