'use client'; import { RefreshCw, AlertCircle } from 'lucide-react'; import type { WidgetConfig } from '@/lib/pipeline-types'; interface WidgetWrapperProps { config: WidgetConfig; loading: boolean; error?: string; onRefresh?: () => void; children: React.ReactNode; } /** * Common wrapper for dashboard widgets. * Handles loading, error states, and refresh functionality. */ export function WidgetWrapper({ config, loading, error, onRefresh, children, }: WidgetWrapperProps) { return (
{/* Header */}

{config.title}

{onRefresh && ( )}
{/* Content */}
{error ? (

{error}

) : loading ? (
) : ( children )}
); }