import { Suspense } from "react"; import { requireUser } from "@/lib/auth/session.ts"; import { all } from "@/lib/db/index.ts"; import { ChatApp } from "@/components/chat/chat-app"; export const metadata = { title: "Chat" }; export default async function ChatPage() { const user = await requireUser(); const courses = all<{ code: string; title: string; color: string }>( `SELECT c.code, c.title, c.color FROM courses c JOIN enrollments e ON e.course_code = c.code WHERE e.user_id = ? AND c.active = 1 ORDER BY c.code`, user.id ); return ( ); }