Files
NextEdu/src/app/(dashboard)/teacher/textbooks/[id]/loading.tsx
SpecialX 21142f9b99 feat(app): add error/loading boundaries across all dashboard routes and new routes
- Add error.tsx and loading.tsx boundaries for admin, parent, student, teacher routes

- Add admin announcements edit, audit-logs overview, curriculum-map, invitation-codes, permissions, questions, roles routes

- Add admin elective detail and components, files, course-plans, users, scheduling boundaries

- Add messages group-compose route

- Add parent course-plans, elective, grades report-card, practice routes

- Add student course-plans, elective detail, error-book dialogs, grades report-card, learning study-path, leave, schedule boundaries

- Add teacher attendance report, classes boundaries, course-plans boundaries, elective, exams analytics/edit-rich/all/create/new, grades report-card, homework boundaries, leave, lesson-plans calendar

- Add auth loading, onboarding loading, api cron
2026-07-03 10:26:25 +08:00

50 lines
1.8 KiB
TypeScript

import { Skeleton } from "@/shared/components/ui/skeleton"
export default function Loading() {
return (
<div
role="status"
aria-busy="true"
aria-label="加载中"
className="flex h-[calc(100vh-4rem)] flex-col overflow-hidden bg-muted/5"
>
{/* Reader Header Skeleton */}
<div className="flex items-center justify-between border-b bg-background/95 backdrop-blur py-3 px-6 shrink-0">
<div className="flex items-center gap-3 min-w-0">
<Skeleton className="h-6 w-48" />
<div className="flex items-center gap-2">
<Skeleton className="h-5 w-16 rounded-full" />
<Skeleton className="h-5 w-16 rounded-full" />
</div>
</div>
</div>
{/* Reader Body Skeleton: sidebar + content */}
<div className="flex-1 overflow-hidden">
<div className="h-full max-w-[1600px] mx-auto w-full grid grid-cols-1 md:grid-cols-[280px_1fr]">
{/* Chapter Sidebar Skeleton */}
<div className="hidden md:block border-r bg-card p-4 space-y-2 overflow-hidden">
{Array.from({ length: 8 }).map((_, i) => (
<div key={i} className="flex items-center gap-2">
<Skeleton className="h-4 w-4 rounded-sm" />
<Skeleton className="h-6 w-full" />
</div>
))}
</div>
{/* Content Area Skeleton */}
<div className="p-6 space-y-4 overflow-hidden">
<Skeleton className="h-8 w-1/3" />
<div className="space-y-3">
{Array.from({ length: 6 }).map((_, i) => (
<Skeleton key={i} className="h-4 w-full" />
))}
</div>
<Skeleton className="h-32 w-full" />
</div>
</div>
</div>
</div>
)
}