import { notFound } from "next/navigation" import { BookOpen, Inbox } 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 { getDemoStudentUser } from "@/modules/homework/data-access" export const dynamic = "force-dynamic" export default async function StudentTextbookDetailPage({ params, }: { params: Promise<{ id: string }> }) { const student = await getDemoStudentUser() if (!student) { return (

Textbook

Read chapters and review content.

) } const { id } = await params const [textbook, chapters, knowledgePoints] = await Promise.all([ getTextbookById(id), getChaptersByTextbookId(id), getKnowledgePointsByTextbookId(id) ]) if (!textbook) notFound() return (

{textbook.title}

{textbook.subject} {textbook.grade && ( {textbook.grade} )}
{chapters.length === 0 ? (
) : (
)}
) }