"use client" import { i18n } from "@frontend/lib/i18n" import { t_globalErrorButton, t_globalErrorDescription1, t_globalErrorDescription2, t_globalErrorSubtitle, t_globalErrorTitle, } from "@shared/i18n/messages/t-global-error" import { LoggerErrorEnum } from "@shared/enums/logger-error-enum" import { logger } from "@frontend/lib/logger" import MyButton from "@frontend/components/user-input/my-button" import { Readex_Pro } from "next/font/google" const font = Readex_Pro({ subsets: ["latin"], display: "swap", }) export default function GlobalError({ error, reset, }: { error: Error & { digest?: string } reset: () => void }) { const locale = i18n.defaultLocale // Error before locale is resolved logger.error({ msg: "Unhandled error caught by the global error handler", handler: "app/global-error.tsx", type: LoggerErrorEnum.CLIENT_ERROR, error, }) return (
{t_globalErrorSubtitle(locale)}
{t_globalErrorDescription1(locale)}
{t_globalErrorDescription2(locale)}