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 bd32e067c4
All checks were successful
Chromatic / chromatic (push) Successful in 2m33s
CI / ci (push) Successful in 3m13s
CI / commitlint (push) Successful in 14s
Release / release (push) Successful in 55s
feat: initial release
2024-07-24 12:59:33 +02:00

35 lines
848 B
TypeScript

"use client"
import { Button } from "@repo/ui/design/Button"
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 className="items-center justify-center text-center">
<h1 className="text-3xl font-semibold">
{t("errors.error")} 500 - {t("errors.server-error")}
</h1>
<p className="mb-4 mt-2">
<Button onClick={reset}>{t("errors.try-again")}</Button>
</p>
</MainLayout>
)
}
export default ErrorBoundaryPage