1cf9fd9d8c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1015 B
TypeScript
28 lines
1015 B
TypeScript
"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>
|
||
);
|
||
}
|