18 lines
567 B
TypeScript
18 lines
567 B
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
|
|
export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
|
|
useEffect(() => {
|
|
console.error("App error:", error);
|
|
}, [error]);
|
|
|
|
return (
|
|
<div className="flex flex-col items-center gap-4 py-20">
|
|
<h2 className="text-xl font-bold">Fehler aufgetreten</h2>
|
|
<pre className="bg-base-200 rounded p-4 text-sm max-w-xl overflow-auto">{error.message}</pre>
|
|
<button className="btn btn-primary" onClick={reset}>Neu laden</button>
|
|
</div>
|
|
);
|
|
}
|