diff --git a/frontend/src/components/pages/CCPMetricsPage.js b/frontend/src/components/pages/CCPMetricsPage.js index dd630a0..f0de15f 100644 --- a/frontend/src/components/pages/CCPMetricsPage.js +++ b/frontend/src/components/pages/CCPMetricsPage.js @@ -100,55 +100,55 @@ function StatsBar({ stats, onNonCompliantClick, ncExpanded }) { // --------------------------------------------------------------------------- // Metric Breakdown Panel (shown when Non-Compliant is clicked) // --------------------------------------------------------------------------- -function MetricBreakdownPanel({ metrics, onSelectMetric }) { +function MetricBreakdownPanel({ metrics }) { + const [showAll, setShowAll] = useState(false); + if (!metrics || metrics.length === 0) return null; // Only show metrics with non_compliant > 0 const ncMetrics = metrics.filter(m => m.non_compliant > 0); if (ncMetrics.length === 0) return null; + const TOP_COUNT = 8; + const displayMetrics = showAll ? ncMetrics : ncMetrics.slice(0, TOP_COUNT); + const hasMore = ncMetrics.length > TOP_COUNT; + return (