import { RSRP_LEGEND } from '@/constants/rsrp-thresholds.ts'; import { useCoverageStore } from '@/store/coverage.ts'; import { useSitesStore } from '@/store/sites.ts'; export default function Legend() { const result = useCoverageStore((s) => s.result); const heatmapVisible = useCoverageStore((s) => s.heatmapVisible); const toggleHeatmap = useCoverageStore((s) => s.toggleHeatmap); const settings = useCoverageStore((s) => s.settings); const sites = useSitesStore((s) => s.sites); if (!result) return null; // Estimate coverage area: total points * resolution^2 const areaKm2 = (result.totalPoints * settings.resolution * settings.resolution) / 1e6; return (
{/* Header with toggle */}

Signal (RSRP)

{/* Legend items */}
{RSRP_LEGEND.map((item) => (
{item.label}: {item.range}
))}
{/* Stats */}
Points: {result.totalPoints.toLocaleString()}
Time: {(result.calculationTime / 1000).toFixed(2)}s
Area: ~{areaKm2.toFixed(1)} km²
Sites: {sites.length}
); }