'use client'
import { useEffect } from 'react'
import Link from 'next/link'
import { Header } from '@/components/header'
import { Footer } from '@/components/footer'
import { Button } from '@/components/ui/button'
import { Card, CardContent } from '@/components/ui/card'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { RefreshCcw, Home, AlertTriangle, Server } from 'lucide-react'
interface ErrorProps {
error: Error & { digest?: string }
reset: () => void
}
export default function Error({ error, reset }: ErrorProps) {
useEffect(() => {
// Log the error to an error reporting service
console.error('Application error:', error)
}, [error])
return (
{/* Error Visual */}
Something Went Wrong
We encountered an unexpected error. Our team has been notified and is working on a fix.
{/* Error Details */}
Error: {error.message || 'An unexpected error occurred'}
{error.digest && (
Error ID: {error.digest}
)}
{/* Recovery Actions */}
If the problem persists, you can:
{/* Technical Details */}
Technical Details (for developers)
Error Message: {error.message}
{error.stack && (
<>
Stack Trace:
{error.stack}
>
)}
)
}