"use client"

import { useEffect } from "react"
import { useTranslations } from "next-intl"
import { Button } from "@/shared/components/ui/button"

export default function PracticeError({
  error,
  reset,
}: {
  error: Error & { digest?: string }
  reset: () => void
}): React.ReactNode {
  const t = useTranslations("student")
  useEffect(() => {
    console.error("Practice page 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>
      <Button onClick={reset}>{t("error.retry")}</Button>
    </div>
  )
}
