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 ( +