import React from 'react'; import { Loader2, RefreshCw, AlertCircle } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; interface LoadingStateProps { isLoading?: boolean; error?: Error | null; onRetry?: () => void; loadingText?: string; errorText?: string; children?: React.ReactNode; className?: string; } const LoadingState: React.FC = ({ isLoading = false, error = null, onRetry, loadingText = 'Loading...', errorText = 'Failed to load data', children, className = '' }) => { if (error) { return (

{errorText}

{error.message}

{onRetry && ( )}
); } if (isLoading) { return (

{loadingText}

); } return <>{children}; }; export default LoadingState;