- Add admin/lesson-plans, parent/lesson-plans, student/lesson-plans routes - Add student/practice and teacher/practice routes for adaptive practice - Add management/grade/dashboard and management/grade/practice routes - Add teacher/lesson-plans error and loading boundaries - Update existing admin, parent, student, teacher pages with new features - Update globals.css and proxy middleware
33 lines
954 B
TypeScript
33 lines
954 B
TypeScript
"use client"
|
|
|
|
import { useEffect } from "react"
|
|
import Link from "next/link"
|
|
import { useTranslations } from "next-intl"
|
|
import { Button } from "@/shared/components/ui/button"
|
|
|
|
export default function PracticeSessionError({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string }
|
|
reset: () => void
|
|
}): React.ReactNode {
|
|
const t = useTranslations("student")
|
|
useEffect(() => {
|
|
console.error("Practice session error:", error)
|
|
}, [error])
|
|
|
|
return (
|
|
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
|
|
<h2 className="text-xl font-semibold">{t("error.title")}</h2>
|
|
<p className="text-sm text-muted-foreground">{error.message}</p>
|
|
<div className="flex gap-2">
|
|
<Button onClick={reset}>{t("error.retry")}</Button>
|
|
<Button variant="outline" asChild>
|
|
<Link href="/student/practice">{t("classDetail.backToCourses")}</Link>
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|