diff --git a/src/app/[locale]/error.tsx b/src/app/[locale]/error.tsx new file mode 100644 index 0000000..bdf10cc --- /dev/null +++ b/src/app/[locale]/error.tsx @@ -0,0 +1,51 @@ +"use client"; + +import { useTranslations } from "next-intl"; +import { Button } from "@/components/ui/button"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; + +interface ErrorProps { + error: Error & { digest?: string }; + reset: () => void; +} + +export default function Error({ error, reset }: ErrorProps) { + const t = useTranslations("Fallback.Error"); + + const handleRetry = () => { + if (typeof window !== "undefined" && "unstable_retry" in window.location) { + (window.location as unknown as { unstable_retry: () => void }).unstable_retry(); + } else { + reset(); + } + }; + + return ( +
+ + + {t("Title")} + {t("Description")} + + + + + +
+ ); +} diff --git a/src/app/[locale]/qa/route-error/page.tsx b/src/app/[locale]/qa/route-error/page.tsx new file mode 100644 index 0000000..0588523 --- /dev/null +++ b/src/app/[locale]/qa/route-error/page.tsx @@ -0,0 +1,5 @@ +"use client"; + +export default function RouteErrorPage() { + throw new Error("Intentional error for QA testing - this should trigger the error boundary"); +}