import React from 'react'; import { Skeleton } from '@/components/ui/skeleton'; import { Button } from '@/components/ui/button'; import { AlertTriangle, BarChart3, RotateCcw } from 'lucide-react'; interface ChartStatesProps { isLoading: boolean; error: Error | null; isEmpty: boolean; onRetry: () => void; title: string; emptyTitle: string; emptyDescription: string; errorMessage: string; retryLabel: string; children: React.ReactNode; } export const ChartCard: React.FC = ({ isLoading, error, isEmpty, onRetry, title, emptyTitle, emptyDescription, errorMessage, retryLabel, children, }) => { return (

{title}

{isLoading ? (
) : error ? (

{errorMessage}

) : isEmpty ? (

{emptyTitle}

{emptyDescription}

) : ( children )}
); };