import { Button } from "./button"; import { Card, CardContent, CardHeader, CardTitle } from "./card"; import { Badge } from "./badge"; import { AlertTriangle, RefreshCw, Home, Bug } from "lucide-react"; interface ErrorFallbackProps { error?: Error; resetErrorBoundary?: () => void; title?: string; description?: string; } export const ErrorFallback = ({ error, resetErrorBoundary, title = "حدث خطأ غير متوقع", description = "نعتذر عن هذا الخطأ. يرجى المحاولة مرة أخرى." }: ErrorFallbackProps) => { const handleReload = () => { window.location.reload(); }; const handleGoHome = () => { window.location.href = '/'; }; return (
{description}
{error && (
{error.message}
إذا استمر الخطأ، يرجى التواصل مع الدعم الفني