diff --git a/client/src/components/admin/ProgramResultsSummarySection.tsx b/client/src/components/admin/ProgramResultsSummarySection.tsx index 2be410a..6da4b0f 100644 --- a/client/src/components/admin/ProgramResultsSummarySection.tsx +++ b/client/src/components/admin/ProgramResultsSummarySection.tsx @@ -1,13 +1,5 @@ import { useEffect, useState } from "react"; import { ExternalLink, Github, Loader2 } from "lucide-react"; -import { - BarChart, - Bar, - XAxis, - YAxis, - Tooltip, - ResponsiveContainer, -} from "recharts"; import { api, USE_MOCK_DATA, @@ -156,55 +148,27 @@ function FeedbackChart({ }) { const entries = Object.entries(counts).sort((a, b) => b[1] - a[1]); if (entries.length === 0) return null; - const data = entries.map(([name, value]) => ({ name, value })); - const maxVal = Math.max(...data.map((d) => d.value)); - - // min-w-[1px] + debounce prevents Recharts creating a 0-dim canvas pattern - // when the admin panel first opens (layout still in flight). - // Y-axis width is computed from the longest label so long option strings - // don't overflow; tickFormatter truncates anything that still doesn't fit. - const longestLabel = Math.max(...entries.map(([k]) => k.length)); - const yAxisWidth = Math.min(160, Math.max(80, Math.ceil(longestLabel * 5.4))); - const maxChars = Math.floor(yAxisWidth / 5.4); + const maxVal = Math.max(...entries.map(([, v]) => v)); return ( -
-
{title.toUpperCase()}
- - - - v.length > maxChars ? v.slice(0, maxChars - 1) + "…" : v} - tick={{ fontSize: 9, fontFamily: "monospace", fill: "var(--color-label-mid)" }} - tickLine={false} - axisLine={false} - /> - - - - +
+
{title.toUpperCase()}
+
+ {entries.map(([label, count]) => ( +
+
{label}
+
+
+
+
+ {count} +
+
+ ))} +
); }