'use client'; import { useEffect } from 'react'; import Link from 'next/link'; interface ErrorProps { error: Error & { digest?: string }; reset: () => void; } /** * Error Boundary for App Router segments * * Catches errors in child components and displays a fallback UI. * Users can attempt to recover by re-rendering the segment. */ export default function Error({ error, reset }: ErrorProps) { useEffect(() => { // Log error to console in development if (process.env.NODE_ENV === 'development') { console.error('Error caught by boundary:', error); } // In production, you could send to an error tracking service here }, [error]); return (

Something went wrong

An unexpected error occurred. Don't worry, your data is safe.

{process.env.NODE_ENV === 'development' && error.message && (

{error.message}

)}
Go home
); }