// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0 "use client" // The last boundary: the root layout itself threw, so there is no document, no stylesheet and no // provider of strings -- this file renders its own and carries its own two languages, chosen // from the browser's. The server has already logged the error; this reports the browser's side. import { useEffect } from "react" import { reportClientError } from "../src/observe/browser" const STRINGS = { en: { title: "Something went wrong", body: "The app could not be shown. Try again.", retry: "Try again" }, lt: { title: "Kažkas nepavyko", body: "Programos parodyti nepavyko. Bandykite dar kartą.", retry: "Bandyti dar kartą", }, } as const export default function GlobalError({ error, retry }: { error: Error & { digest?: string }; retry: () => void }) { useEffect(() => { reportClientError(error) }, [error]) const locale = typeof navigator !== "undefined" && navigator.language.toLowerCase().startsWith("lt") ? "lt" : "en" const strings = STRINGS[locale] return (

{strings.title}

{strings.body}

) }