diff --git a/app/(app)/error.tsx b/app/(app)/error.tsx new file mode 100644 index 0000000..4992aa1 --- /dev/null +++ b/app/(app)/error.tsx @@ -0,0 +1,77 @@ +/** + * @file app/(app)/error.tsx + * @description Client-side error boundary component that renders an error fallback UI with recovery and navigation actions. + */ + +"use client"; + +import Link from "next/link"; +import { AlertTriangle, RefreshCw, ArrowLeft } from "lucide-react"; + +/** + * Properties for the ErrorBoundary component. + * + * @interface ErrorBoundaryProps + * @property {Error & { digest?: string }} error - The error object caught by the Next.js error boundary. + * @property {() => void} reset - Function to reset the error boundary and attempt to re-render the segment. + */ +interface ErrorBoundaryProps { + error: Error & { digest?: string }; + reset: () => void; +} + +/** + * Renders an error boundary fallback UI displaying error details, a retry button, and navigation back to the summary page. + * + * @param {ErrorBoundaryProps} props - The component props. + * @returns {JSX.Element} The rendered error boundary fallback component. + */ +export default function ErrorBoundary({ error, reset }: ErrorBoundaryProps) { + return ( +
+ An unexpected error occurred while processing your request. You can + try reloading this section or head back to your summary. +
+ {error?.message && ( +