import { notFound } from "next/navigation" import { BookOpen } from "lucide-react" import { getTextbookById, getChaptersByTextbookId, getKnowledgePointsByTextbookId } from "@/modules/textbooks/data-access" import { TextbookReader } from "@/modules/textbooks/components/textbook-reader" import { Badge } from "@/shared/components/ui/badge" import { EmptyState } from "@/shared/components/ui/empty-state" import { getCurrentStudentUser } from "@/modules/users/data-access" export const dynamic = "force-dynamic" export default async function StudentTextbookDetailPage({ params, }: { params: Promise<{ id: string }> }) { const student = await getCurrentStudentUser() if (!student) return notFound() const { id } = await params const [textbook, chapters, knowledgePoints] = await Promise.all([ getTextbookById(id), getChaptersByTextbookId(id), getKnowledgePointsByTextbookId(id) ]) if (!textbook) notFound() return (

{textbook.title}

{chapters.length === 0 ? (
) : (
)}
) }