feat(classes): optimize teacher dashboard ui and implement grade management

This commit is contained in:
SpecialX
2026-01-14 13:59:11 +08:00
parent ade8d4346c
commit 9bfc621d3f
104 changed files with 12793 additions and 2309 deletions

View File

@@ -39,36 +39,40 @@ export default async function StudentTextbookDetailPage({
if (!textbook) notFound()
return (
<div className="flex h-[calc(100vh-4rem)] flex-col overflow-hidden">
<div className="flex items-center gap-4 border-b bg-background py-4 shrink-0 z-10">
<Button variant="ghost" size="icon" asChild>
<div className="flex h-[calc(100vh-4rem)] flex-col overflow-hidden bg-muted/5">
<div className="flex items-center gap-4 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 py-3 px-6 shrink-0 z-10">
<Button variant="ghost" size="sm" className="gap-2 text-muted-foreground hover:text-foreground" asChild>
<Link href="/student/learning/textbooks">
<ArrowLeft className="h-4 w-4" />
Back
</Link>
</Button>
<div className="w-px h-8 bg-border mx-2" />
<div className="flex-1 min-w-0">
<div className="flex items-center gap-2 mb-1">
<Badge variant="outline">{textbook.subject}</Badge>
<span className="text-xs text-muted-foreground uppercase tracking-wider font-medium">
{textbook.grade ?? "-"}
</span>
<div className="flex items-center gap-2">
<h1 className="text-lg font-bold tracking-tight truncate mr-2">{textbook.title}</h1>
<Badge variant="secondary" className="font-normal text-xs">{textbook.subject}</Badge>
{textbook.grade && (
<span className="text-xs text-muted-foreground border px-1.5 py-0.5 rounded">
{textbook.grade}
</span>
)}
</div>
<h1 className="text-xl font-bold tracking-tight line-clamp-1">{textbook.title}</h1>
</div>
</div>
<div className="flex-1 overflow-hidden pt-6">
<div className="flex-1 overflow-hidden p-6">
{chapters.length === 0 ? (
<div className="px-8">
<div className="h-full flex items-center justify-center rounded-lg border border-dashed bg-card">
<EmptyState
icon={BookOpen}
title="No chapters"
description="This textbook has no chapters yet."
className="bg-card"
className="border-none shadow-none"
/>
</div>
) : (
<div className="h-[calc(100vh-140px)] px-8 min-h-0">
<div className="h-full min-h-0 max-w-[1600px] mx-auto w-full">
<TextbookReader chapters={chapters} />
</div>
)}