feat(logging): wire useErrorReport into all 129 error.tsx boundaries

所有 129 个 error.tsx 客户端错误边界接入 useErrorReport Hook,客户端路由错误自动上报到 /api/client-error 端点,服务端通过 pino logger 统一记录。移除了 7 处 useEffect + console.error 调用。为无 props 的 error.tsx 补全 error 参数解构。
This commit is contained in:
SpecialX
2026-07-07 12:52:32 +08:00
parent 4122175915
commit 7c1b764b59
129 changed files with 396 additions and 104 deletions

View File

@@ -2,8 +2,10 @@
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AuthError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AuthError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full w-full flex-col items-center justify-center gap-4 p-4 text-center"> <div className="flex h-full w-full flex-col items-center justify-center gap-4 p-4 text-center">
<div className="flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10"> <div className="flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10">

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function EditAnnouncementError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function EditAnnouncementError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("announcements") const t = useTranslations("announcements")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminAnnouncementsError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminAnnouncementsError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("announcements") const t = useTranslations("announcements")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminAttendanceError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminAttendanceError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="attendance" /> return <RouteErrorBoundary reset={reset} namespace="attendance" />
} }

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function DataChangeLogsError({ export default function DataChangeLogsError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("audit") const t = useTranslations("audit")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AuditLogsError({ export default function AuditLogsError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("audit") const t = useTranslations("audit")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function LoginLogsError({ export default function LoginLogsError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("audit") const t = useTranslations("audit")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AuditOverviewError({ export default function AuditOverviewError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("audit") const t = useTranslations("audit")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function EditCoursePlanError() { export default function EditCoursePlanError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminCoursePlanDetailError() { export default function AdminCoursePlanDetailError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function CreateCoursePlanError() { export default function CreateCoursePlanError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminCoursePlansError() { export default function AdminCoursePlansError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { DashboardErrorFallback } from "@/modules/dashboard/components/dashboard-error-fallback" import { DashboardErrorFallback } from "@/modules/dashboard/components/dashboard-error-fallback"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminDashboardError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminDashboardError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <DashboardErrorFallback error={error} reset={reset} /> return <DashboardErrorFallback error={error} reset={reset} />
} }

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminElectiveError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminElectiveError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("elective") const t = useTranslations("elective")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,8 +3,10 @@
import { BarChart3 } from "lucide-react" import { BarChart3 } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminErrorBookError() { export default function AdminErrorBookError({ error }: { error: Error & { digest?: string } }) {
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("dashboard") const t = useTranslations("dashboard")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,6 +4,7 @@ import { FileWarning } from "lucide-react"
import type { ReactElement } from "react" import type { ReactElement } from "react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminFilesError({ export default function AdminFilesError({
error, error,
@@ -13,6 +14,7 @@ export default function AdminFilesError({
reset: () => void reset: () => void
}): ReactElement { }): ReactElement {
const t = useTranslations("files") const t = useTranslations("files")
useErrorReport(error)
return ( return (
<div <div
role="alert" role="alert"

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { BookOpen } from "lucide-react" import { BookOpen } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminLessonPlanViewError() { export default function AdminLessonPlanViewError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("lessonPreparation") const t = useTranslations("lessonPreparation")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { BookOpen } from "lucide-react" import { BookOpen } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminLessonPlansError() { export default function AdminLessonPlansError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("lessonPreparation") const t = useTranslations("lessonPreparation")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,6 +3,7 @@
import { KeyRound } from "lucide-react" import { KeyRound } from "lucide-react"
import type { ReactElement } from "react" import type { ReactElement } from "react"
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminPermissionsError({ export default function AdminPermissionsError({
error, error,
@@ -11,6 +12,7 @@ export default function AdminPermissionsError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}): ReactElement { }): ReactElement {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<KeyRound className="h-12 w-12 text-destructive" aria-hidden="true" /> <KeyRound className="h-12 w-12 text-destructive" aria-hidden="true" />

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminQuestionsError({ export default function AdminQuestionsError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("questions") const t = useTranslations("questions")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,6 +3,7 @@
import { ShieldAlert } from "lucide-react" import { ShieldAlert } from "lucide-react"
import type { ReactElement } from "react" import type { ReactElement } from "react"
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminRoleDetailError({ export default function AdminRoleDetailError({
error, error,
@@ -11,6 +12,7 @@ export default function AdminRoleDetailError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}): ReactElement { }): ReactElement {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<ShieldAlert className="h-12 w-12 text-destructive" aria-hidden="true" /> <ShieldAlert className="h-12 w-12 text-destructive" aria-hidden="true" />

View File

@@ -3,6 +3,7 @@
import { ShieldAlert } from "lucide-react" import { ShieldAlert } from "lucide-react"
import type { ReactElement } from "react" import type { ReactElement } from "react"
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminRolesError({ export default function AdminRolesError({
error, error,
@@ -11,6 +12,7 @@ export default function AdminRolesError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}): ReactElement { }): ReactElement {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<ShieldAlert className="h-12 w-12 text-destructive" aria-hidden="true" /> <ShieldAlert className="h-12 w-12 text-destructive" aria-hidden="true" />

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminSchedulingAutoError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminSchedulingAutoError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminSchedulingChangesError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminSchedulingChangesError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminSchedulingRulesError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminSchedulingRulesError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminAcademicYearError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminAcademicYearError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminClassesError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminClassesError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminDepartmentsError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminDepartmentsError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -5,14 +5,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminGradesError({ export default function AdminGradesError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}): JSX.Element { }): JSX.Element {
const t = useTranslations("grades") const t = useTranslations("grades")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -5,14 +5,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminGradesInsightsError({ export default function AdminGradesInsightsError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}): JSX.Element { }): JSX.Element {
const t = useTranslations("grades") const t = useTranslations("grades")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminSchoolsError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminSchoolsError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,6 +3,7 @@
import { Users } from "lucide-react" import { Users } from "lucide-react"
import type { ReactElement } from "react" import type { ReactElement } from "react"
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminUsersError({ export default function AdminUsersError({
error, error,
@@ -11,6 +12,7 @@ export default function AdminUsersError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}): ReactElement { }): ReactElement {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<Users className="h-12 w-12 text-destructive" aria-hidden="true" /> <Users className="h-12 w-12 text-destructive" aria-hidden="true" />

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AdminUsersImportError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AdminUsersImportError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AnnouncementDetailError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AnnouncementDetailError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("announcements") const t = useTranslations("announcements")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AnnouncementsError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AnnouncementsError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("announcements") const t = useTranslations("announcements")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { DashboardErrorFallback } from "@/modules/dashboard/components/dashboard-error-fallback" import { DashboardErrorFallback } from "@/modules/dashboard/components/dashboard-error-fallback"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function DashboardError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function DashboardError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <DashboardErrorFallback error={error} reset={reset} /> return <DashboardErrorFallback error={error} reset={reset} />
} }

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function Error({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4"> <div className="flex h-full flex-col items-center justify-center space-y-4">
<EmptyState <EmptyState

View File

@@ -3,13 +3,16 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ManagementGradeClassesError({ export default function ManagementGradeClassesError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,8 +3,10 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ManagementGradeError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function ManagementGradeError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,13 +3,16 @@
import { AlertCircle } from "lucide-react" import { AlertCircle } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ManagementGradeInsightsError({ export default function ManagementGradeInsightsError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -1,10 +1,10 @@
"use client" "use client"
import { useEffect } from "react"
import { BarChart3 } from "lucide-react" import { BarChart3 } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function GradePracticeError({ export default function GradePracticeError({
error, error,
@@ -14,9 +14,7 @@ export default function GradePracticeError({
reset: () => void reset: () => void
}): React.ReactNode { }): React.ReactNode {
const t = useTranslations("practice") const t = useTranslations("practice")
useEffect(() => { useErrorReport(error)
console.error("Grade practice analytics page error:", error)
}, [error])
return ( return (
<div className="flex h-full flex-col space-y-8 p-8"> <div className="flex h-full flex-col space-y-8 p-8">

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function MessageDetailError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function MessageDetailError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("messages") const t = useTranslations("messages")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ComposeMessageError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function ComposeMessageError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("messages") const t = useTranslations("messages")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function MessagesError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function MessagesError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("messages") const t = useTranslations("messages")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function GroupComposeMessageError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function GroupComposeMessageError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("messages") const t = useTranslations("messages")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentAttendanceError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function ParentAttendanceError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="attendance" /> return <RouteErrorBoundary reset={reset} namespace="attendance" />
} }

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentCoursePlanDetailError() { export default function ParentCoursePlanDetailError({ error }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentCoursePlansError() { export default function ParentCoursePlansError({ error }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { DashboardErrorFallback } from "@/modules/dashboard/components/dashboard-error-fallback" import { DashboardErrorFallback } from "@/modules/dashboard/components/dashboard-error-fallback"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentDashboardError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function ParentDashboardError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <DashboardErrorFallback error={error} reset={reset} /> return <DashboardErrorFallback error={error} reset={reset} />
} }

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentDiagnosticError({ export default function ParentDiagnosticError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("diagnostic") const t = useTranslations("diagnostic")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentElectiveError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function ParentElectiveError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("elective") const t = useTranslations("elective")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -3,8 +3,10 @@
import { BookX } from "lucide-react" import { BookX } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentErrorBookError() { export default function ParentErrorBookError({ error }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
import { AlertTriangle } from "lucide-react" import { AlertTriangle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
@@ -12,6 +13,7 @@ export default function ParentError({
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("common") const t = useTranslations("common")
useErrorReport(error)
return ( return (
<div className="p-6 md:p-8"> <div className="p-6 md:p-8">

View File

@@ -5,14 +5,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentGradesError({ export default function ParentGradesError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}): JSX.Element { }): JSX.Element {
const t = useTranslations("grades") const t = useTranslations("grades")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -1,10 +1,10 @@
"use client" "use client"
import type { JSX } from "react" import type { JSX } from "react"
import { useEffect } from "react"
import { AlertTriangle } from "lucide-react" import { AlertTriangle } from "lucide-react"
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function Error({ export default function Error({
error, error,
@@ -14,9 +14,7 @@ export default function Error({
reset: () => void reset: () => void
}): JSX.Element { }): JSX.Element {
const t = useTranslations("grades") const t = useTranslations("grades")
useEffect(() => { useErrorReport(error)
console.error("[ReportCard] Route error:", error)
}, [error])
return ( return (
<div className="flex h-full flex-col items-center justify-center gap-4 p-12"> <div className="flex h-full flex-col items-center justify-center gap-4 p-12">

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { BookOpen } from "lucide-react" import { BookOpen } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentLessonPlanViewError() { export default function ParentLessonPlanViewError({ error }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("lessonPreparation") const t = useTranslations("lessonPreparation")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { BookOpen } from "lucide-react" import { BookOpen } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentLessonPlansError() { export default function ParentLessonPlansError({ error }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("lessonPreparation") const t = useTranslations("lessonPreparation")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -5,14 +5,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ParentPracticeError({ export default function ParentPracticeError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}): JSX.Element { }): JSX.Element {
const t = useTranslations("practice") const t = useTranslations("practice")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ProfileError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function ProfileError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("settings.errors") const t = useTranslations("settings.errors")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function SettingsError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function SettingsError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("settings.errors") const t = useTranslations("settings.errors")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function SecuritySettingsError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function SecuritySettingsError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("settings.errors") const t = useTranslations("settings.errors")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentAttendanceError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function StudentAttendanceError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="attendance" /> return <RouteErrorBoundary reset={reset} namespace="attendance" />
} }

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentCoursePlanDetailError() { export default function StudentCoursePlanDetailError({ error }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentCoursePlansError() { export default function StudentCoursePlansError({ error }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { DashboardErrorFallback } from "@/modules/dashboard/components/dashboard-error-fallback" import { DashboardErrorFallback } from "@/modules/dashboard/components/dashboard-error-fallback"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentDashboardError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function StudentDashboardError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <DashboardErrorFallback error={error} reset={reset} /> return <DashboardErrorFallback error={error} reset={reset} />
} }

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentDiagnosticError({ export default function StudentDiagnosticError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("student") const t = useTranslations("student")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentElectiveError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function StudentElectiveError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("elective") const t = useTranslations("elective")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { BookX } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentErrorBookError() { export default function StudentErrorBookError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("student") const t = useTranslations("student")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -4,6 +4,7 @@ import { AlertTriangle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentError({ export default function StudentError({
error, error,
@@ -13,6 +14,7 @@ export default function StudentError({
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("student") const t = useTranslations("student")
useErrorReport(error)
return ( return (
<EmptyState <EmptyState
icon={AlertTriangle} icon={AlertTriangle}

View File

@@ -5,14 +5,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentGradesError({ export default function StudentGradesError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}): JSX.Element { }): JSX.Element {
const t = useTranslations("student") const t = useTranslations("student")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -1,10 +1,10 @@
"use client" "use client"
import type { JSX } from "react" import type { JSX } from "react"
import { useEffect } from "react"
import { AlertTriangle } from "lucide-react" import { AlertTriangle } from "lucide-react"
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { useErrorReport } from "@/shared/hooks/use-error-report"
/** /**
* P3-1: 学生报告卡路由错误边界。 * P3-1: 学生报告卡路由错误边界。
@@ -17,9 +17,7 @@ export default function Error({
reset: () => void reset: () => void
}): JSX.Element { }): JSX.Element {
const t = useTranslations("grades") const t = useTranslations("grades")
useEffect(() => { useErrorReport(error)
console.error("[ReportCard] Route error:", error)
}, [error])
return ( return (
<div className="flex h-full flex-col items-center justify-center gap-4 p-12"> <div className="flex h-full flex-col items-center justify-center gap-4 p-12">

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentAssignmentDetailError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function StudentAssignmentDetailError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("examHomework") const t = useTranslations("examHomework")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,13 +4,15 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
/** /**
* student/learning/assignments/[assignmentId]/result/error.tsx * student/learning/assignments/[assignmentId]/result/error.tsx
* 学生作业结果页错误边界。 * 学生作业结果页错误边界。
*/ */
export default function StudentResultError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function StudentResultError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("examHomework") const t = useTranslations("examHomework")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { ErrorState } from "@/shared/components/error-state" import { ErrorState } from "@/shared/components/error-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentClassDetailError({ export default function StudentClassDetailError({
error, error,
@@ -9,5 +10,6 @@ export default function StudentClassDetailError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <ErrorState error={error} reset={reset} namespace="student" /> return <ErrorState error={error} reset={reset} namespace="student" />
} }

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { ErrorState } from "@/shared/components/error-state" import { ErrorState } from "@/shared/components/error-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentCoursesError({ export default function StudentCoursesError({
error, error,
@@ -9,5 +10,6 @@ export default function StudentCoursesError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <ErrorState error={error} reset={reset} namespace="student" /> return <ErrorState error={error} reset={reset} namespace="student" />
} }

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { ErrorState } from "@/shared/components/error-state" import { ErrorState } from "@/shared/components/error-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentLearningError({ export default function StudentLearningError({
error, error,
@@ -9,5 +10,6 @@ export default function StudentLearningError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <ErrorState error={error} reset={reset} namespace="student" /> return <ErrorState error={error} reset={reset} namespace="student" />
} }

View File

@@ -1,12 +1,15 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentStudyPathError({ export default function StudentStudyPathError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="student" /> return <RouteErrorBoundary reset={reset} namespace="student" />
} }

View File

@@ -1,12 +1,15 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentTextbookDetailError({ export default function StudentTextbookDetailError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="textbooks" /> return <RouteErrorBoundary reset={reset} namespace="textbooks" />
} }

View File

@@ -1,12 +1,15 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentTextbooksError({ export default function StudentTextbooksError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="textbooks" /> return <RouteErrorBoundary reset={reset} namespace="textbooks" />
} }

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentLeaveError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function StudentLeaveError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="leave" /> return <RouteErrorBoundary reset={reset} namespace="leave" />
} }

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { BookOpen } from "lucide-react" import { BookOpen } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentLessonPlanViewError() { export default function StudentLessonPlanViewError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("lessonPreparation") const t = useTranslations("lessonPreparation")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { BookOpen } from "lucide-react" import { BookOpen } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentLessonPlansError() { export default function StudentLessonPlansError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("lessonPreparation") const t = useTranslations("lessonPreparation")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -1,9 +1,9 @@
"use client" "use client"
import { useEffect } from "react"
import Link from "next/link" import Link from "next/link"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function PracticeSessionError({ export default function PracticeSessionError({
error, error,
@@ -13,9 +13,7 @@ export default function PracticeSessionError({
reset: () => void reset: () => void
}): React.ReactNode { }): React.ReactNode {
const t = useTranslations("student") const t = useTranslations("student")
useEffect(() => { useErrorReport(error)
console.error("Practice session error:", error)
}, [error])
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">

View File

@@ -1,8 +1,8 @@
"use client" "use client"
import { useEffect } from "react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { Button } from "@/shared/components/ui/button" import { Button } from "@/shared/components/ui/button"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function PracticeError({ export default function PracticeError({
error, error,
@@ -12,9 +12,7 @@ export default function PracticeError({
reset: () => void reset: () => void
}): React.ReactNode { }): React.ReactNode {
const t = useTranslations("student") const t = useTranslations("student")
useEffect(() => { useErrorReport(error)
console.error("Practice page error:", error)
}, [error])
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { ErrorState } from "@/shared/components/error-state" import { ErrorState } from "@/shared/components/error-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentScheduleError({ export default function StudentScheduleError({
error, error,
@@ -9,5 +10,6 @@ export default function StudentScheduleError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <ErrorState error={error} reset={reset} namespace="student" /> return <ErrorState error={error} reset={reset} namespace="student" />
} }

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function TeacherAttendanceError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function TeacherAttendanceError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="attendance" /> return <RouteErrorBoundary reset={reset} namespace="attendance" />
} }

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AttendanceReportError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AttendanceReportError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="attendance" /> return <RouteErrorBoundary reset={reset} namespace="attendance" />
} }

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AttendanceSheetError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AttendanceSheetError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="attendance" /> return <RouteErrorBoundary reset={reset} namespace="attendance" />
} }

View File

@@ -1,7 +1,9 @@
"use client" "use client"
import { RouteErrorBoundary } from "@/shared/components/route-error" import { RouteErrorBoundary } from "@/shared/components/route-error"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function AttendanceStatsError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function AttendanceStatsError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useErrorReport(error)
return <RouteErrorBoundary reset={reset} namespace="attendance" /> return <RouteErrorBoundary reset={reset} namespace="attendance" />
} }

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { ErrorState } from "@/shared/components/error-state" import { ErrorState } from "@/shared/components/error-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ClassDetailError({ export default function ClassDetailError({
error, error,
@@ -9,5 +10,6 @@ export default function ClassDetailError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <ErrorState error={error} reset={reset} namespace="classes" /> return <ErrorState error={error} reset={reset} namespace="classes" />
} }

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { ErrorState } from "@/shared/components/error-state" import { ErrorState } from "@/shared/components/error-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function MyClassesError({ export default function MyClassesError({
error, error,
@@ -9,5 +10,6 @@ export default function MyClassesError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <ErrorState error={error} reset={reset} namespace="classes" /> return <ErrorState error={error} reset={reset} namespace="classes" />
} }

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { ErrorState } from "@/shared/components/error-state" import { ErrorState } from "@/shared/components/error-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function ScheduleError({ export default function ScheduleError({
error, error,
@@ -9,5 +10,6 @@ export default function ScheduleError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <ErrorState error={error} reset={reset} namespace="classes" /> return <ErrorState error={error} reset={reset} namespace="classes" />
} }

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { ErrorState } from "@/shared/components/error-state" import { ErrorState } from "@/shared/components/error-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function StudentsError({ export default function StudentsError({
error, error,
@@ -9,5 +10,6 @@ export default function StudentsError({
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
useErrorReport(error)
return <ErrorState error={error} reset={reset} namespace="classes" /> return <ErrorState error={error} reset={reset} namespace="classes" />
} }

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function TeacherCoursePlanDetailError() { export default function TeacherCoursePlanDetailError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -3,9 +3,11 @@
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { ClipboardList } from "lucide-react" import { ClipboardList } from "lucide-react"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function TeacherCoursePlansError() { export default function TeacherCoursePlansError({ error }: { error: Error & { digest?: string } }) {
const t = useTranslations("coursePlans") const t = useTranslations("coursePlans")
useErrorReport(error)
return ( return (
<div className="p-8"> <div className="p-8">
<EmptyState <EmptyState

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function DiagnosticClassError({ export default function DiagnosticClassError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("diagnostic") const t = useTranslations("diagnostic")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function TeacherDiagnosticError({ export default function TeacherDiagnosticError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("diagnostic") const t = useTranslations("diagnostic")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,14 +4,17 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function DiagnosticStudentError({ export default function DiagnosticStudentError({
error,
reset, reset,
}: { }: {
error: Error & { digest?: string } error: Error & { digest?: string }
reset: () => void reset: () => void
}) { }) {
const t = useTranslations("diagnostic") const t = useTranslations("diagnostic")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

View File

@@ -4,9 +4,11 @@ import { AlertCircle } from "lucide-react"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { EmptyState } from "@/shared/components/ui/empty-state" import { EmptyState } from "@/shared/components/ui/empty-state"
import { useErrorReport } from "@/shared/hooks/use-error-report"
export default function TeacherElectiveError({ reset }: { error: Error & { digest?: string }; reset: () => void }) { export default function TeacherElectiveError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
const t = useTranslations("elective") const t = useTranslations("elective")
useErrorReport(error)
return ( return (
<div className="flex h-full flex-col items-center justify-center space-y-4 p-8"> <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
<EmptyState <EmptyState

Some files were not shown because too many files have changed in this diff Show More