Files
butcem/src/app/error.tsx
T

28 lines
1015 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import { useEffect } from "react";
import { Button } from "@/components/ui/button";
import { tr } from "@/i18n/tr";
/** Rota hata sınırı. İç detay gösterilmez; yalnızca sunucu loglarıyla eşleşen hata kodu (digest). */
export default function ErrorPage({ error, retry }: { error: unknown; retry: () => void }) {
useEffect(() => {
console.error(error);
}, [error]);
const digest = error instanceof Error && "digest" in error ? String(error.digest) : undefined;
return (
<main className="flex flex-1 flex-col items-center justify-center gap-4 p-8 text-center">
<h1 className="text-2xl font-semibold tracking-tight">{tr.errors.errorTitle}</h1>
<p className="max-w-md text-muted-foreground">{tr.errors.errorDescription}</p>
{digest ? (
<p className="text-xs text-muted-foreground">
{tr.errors.reference}: <code>{digest}</code>
</p>
) : null}
<Button onClick={() => retry()}>{tr.errors.retry}</Button>
</main>
);
}