TypeScript 98.3%
CSS 0.9%
Shell 0.7%
1import { Suspense } from "react";2import { requireUser } from "@/lib/auth/session.ts";3import { all } from "@/lib/db/index.ts";4import { ChatApp } from "@/components/chat/chat-app";56export const metadata = { title: "Chat" };78export default async function ChatPage() {9 const user = await requireUser();10 const courses = all<{ code: string; title: string; color: string }>(11 `SELECT c.code, c.title, c.color FROM courses c JOIN enrollments e ON e.course_code = c.code12 WHERE e.user_id = ? AND c.active = 1 ORDER BY c.code`,13 user.id14 );15 return (16 <Suspense>17 <ChatApp courses={courses} />18 </Suspense>19 );20}21