24 lines
803 B
TypeScript
24 lines
803 B
TypeScript
"use client";
|
|
|
|
import { ErrorState } from "@/components/feedback/error-state";
|
|
|
|
/**
|
|
* Root error boundary — catches anything that escapes a more specific
|
|
* one (see (customer)/error.tsx, (staff)/error.tsx, (owner)/error.tsx),
|
|
* so a crash anywhere in the app shows this app-styled fallback instead
|
|
* of Next's default error page. `reset` re-renders the segment that
|
|
* threw, which is enough to recover from a transient failure (a flaky
|
|
* fetch, a stale cache) without a full page reload.
|
|
*/
|
|
export default function RootError({ reset }: { error: Error & { digest?: string }; reset: () => void }) {
|
|
return (
|
|
<html lang="en">
|
|
<body className="bg-stone font-sans">
|
|
<div id="main-content">
|
|
<ErrorState onRetry={reset} />
|
|
</div>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|