wikipedia-game-solver/apps/website/app/[locale]/error.tsx

35 lines
848 B
TypeScript
Raw Normal View History

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