"use client"; import type { CityStats, CategoryId } from "@transportationer/shared"; import { CATEGORIES } from "@transportationer/shared"; interface StatsBarProps { stats: CityStats | null; activeCategory: CategoryId | "composite"; } export function StatsBar({ stats, activeCategory }: StatsBarProps) { if (!stats) return null; const displayStats = activeCategory === "composite" ? stats.categoryStats : stats.categoryStats.filter((s) => s.category === activeCategory); return (
POIs: {stats.totalPois.toLocaleString()}
Grid: {stats.gridPointCount.toLocaleString()}
{displayStats.map((s) => { const cat = CATEGORIES.find((c) => c.id === s.category); return (
{cat && ( )} {cat?.label ?? s.category}: {s.coveragePct.toFixed(0)}% within threshold
); })}
); }