From 5a30446809d13c272c426a36d573df3be09c83b7 Mon Sep 17 00:00:00 2001 From: sudacode Date: Mon, 16 Mar 2026 01:42:55 -0700 Subject: [PATCH] feat(stats): add click handler to bar charts for word detail navigation --- stats/src/components/trends/TrendChart.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/stats/src/components/trends/TrendChart.tsx b/stats/src/components/trends/TrendChart.tsx index 4a7862e..965d32a 100644 --- a/stats/src/components/trends/TrendChart.tsx +++ b/stats/src/components/trends/TrendChart.tsx @@ -9,9 +9,10 @@ interface TrendChartProps { color: string; type: 'bar' | 'line'; formatter?: (value: number) => string; + onBarClick?: (label: string) => void; } -export function TrendChart({ title, data, color, type, formatter }: TrendChartProps) { +export function TrendChart({ title, data, color, type, formatter, onBarClick }: TrendChartProps) { const tooltipStyle = { background: '#363a4f', border: '1px solid #494d64', borderRadius: 6, color: '#cad3f5', fontSize: 12, }; @@ -27,7 +28,13 @@ export function TrendChart({ title, data, color, type, formatter }: TrendChartPr - + onBarClick(entry.label) : undefined} + /> ) : (