import { AmountDisplay } from '@/components/ui/amount-display'; import { ChartConfig, ChartContainer } from '@/components/ui/chart'; import { ChangeDataPoint } from '@/lib/chart-calculations'; import { cn } from '@/lib/utils'; import { Bar, BarChart, Cell, ReferenceLine, Tooltip, XAxis, YAxis, } from 'recharts'; interface MoMChartProps { data: ChangeDataPoint[]; currencyCode: string; xAxisFormatter?: (value: string) => string; className?: string; } const chartConfig: ChartConfig = { change: { label: 'Change', color: 'var(--color-chart-1)', }, }; interface TooltipPayloadItem { payload?: { month?: string; value?: number; change?: number | null; }; } interface CustomTooltipProps { active?: boolean; payload?: TooltipPayloadItem[]; currencyCode: string; } function CustomTooltip({ active, payload, currencyCode }: CustomTooltipProps) { if (!active || !payload?.length) return null; const data = payload[0].payload; if (!data) return null; const change = data.change; return (