This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
wikipedia-game-solver/apps/website/app/[locale]/error.tsx
Théo LUDWIG 3ae6d2fac3
Some checks failed
Chromatic / chromatic (push) Failing after 42s
CI / ci (push) Successful in 2m44s
CI / commitlint (push) Successful in 14s
chore: initial commit
2024-07-24 12:35:33 +02:00

39 lines
884 B
TypeScript

"use client"
import { MainLayout } from "@repo/ui/MainLayout"
import { useTranslations } from "next-intl"
import { useEffect } from "react"
interface ErrorBoundaryPageProps {
error: Error & { digest?: string }
reset: () => void
}
const ErrorBoundaryPage: React.FC<ErrorBoundaryPageProps> = (props) => {
const { error, reset } = props
const t = useTranslations()
useEffect(() => {
console.error(error)
}, [error])
return (
<MainLayout>
<h1 className="text-3xl font-semibold text-red-600">
{t("errors.error")} 500 - {t("errors.server-error")}
</h1>
<p className="mb-4 mt-2">
<button
className="rounded-md bg-blue-600 px-3 py-2 text-white hover:bg-blue-800"
onClick={reset}
>
{t("errors.try-again")}
</button>
</p>
</MainLayout>
)
}
export default ErrorBoundaryPage