import React from 'react'; import { Card } from '../../ui'; import { LucideIcon } from 'lucide-react'; export interface AnalyticsWidgetProps { title: string; subtitle?: string; icon?: LucideIcon; loading?: boolean; error?: string; className?: string; children: React.ReactNode; actions?: React.ReactNode; } export const AnalyticsWidget: React.FC = ({ title, subtitle, icon: Icon, loading = false, error, className = '', children, actions }) => { if (error) { return (
{Icon && (
)}

{title}

{subtitle &&

{subtitle}

}
{actions}
{Icon && }

Error: {error}

); } if (loading) { return (
{Icon && (
)}

{title}

{subtitle &&

{subtitle}

}
{actions}
); } return (
{Icon && (
)}

{title}

{subtitle &&

{subtitle}

}
{actions}
{children}
); };