import React from 'react'; import { AlertCircle, RefreshCw } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; interface ErrorBoundaryState { hasError: boolean; error?: Error; } interface ErrorBoundaryProps { children: React.ReactNode; fallback?: React.ComponentType<{ error: Error; retry: () => void }>; } class ErrorBoundary extends React.Component { constructor(props: ErrorBoundaryProps) { super(props); this.state = { hasError: false }; } static getDerivedStateFromError(error: Error): ErrorBoundaryState { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { console.error('Asset Management Error Boundary caught an error:', error, errorInfo); } retry = () => { this.setState({ hasError: false, error: undefined }); }; render() { if (this.state.hasError) { if (this.props.fallback) { const FallbackComponent = this.props.fallback; return ; } return ; } return this.props.children; } } const DefaultErrorFallback: React.FC<{ error: Error; retry: () => void }> = ({ error, retry }) => { return ( Something went wrong

An unexpected error occurred in the asset management system.

Error details
            {error.message}
          
); }; export default ErrorBoundary;