'use client'; import { useQuery } from '@tanstack/react-query'; import { Bar, BarChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts'; import { apiFetch } from '@/lib/api/client'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { CardSkeleton } from '@/components/shared/loading-skeleton'; import { stageLabel } from '@/lib/constants'; import { WidgetErrorBoundary } from './widget-error-boundary'; interface PipelineRow { stage: string; count: number; } function PipelineChartInner() { const { data, isLoading } = useQuery({ queryKey: ['dashboard', 'pipeline'], queryFn: () => apiFetch('/api/v1/dashboard/pipeline'), staleTime: 60_000, retry: 2, }); if (isLoading) { return ; } const chartData = (data ?? []).map((row) => ({ stage: stageLabel(row.stage), count: row.count, })); return ( Pipeline Overview ); } export function PipelineChart() { return ( ); }