import { formatCurrency, formatPercent } from '@/lib/format' import { heatmapLegendBounds, HEATMAP_LOW_HEX, HEATMAP_MID_HEX, HEATMAP_HIGH_HEX } from '@/lib/colors' import type { HeatmapMode } from '@/lib/colors' import type { ActivitySimResult } from '@/domain/types' interface HeatmapLegendProps { perActivity: ActivitySimResult[] mode: HeatmapMode currency: string } export function HeatmapLegend({ perActivity, mode, currency }: HeatmapLegendProps) { const bounds = heatmapLegendBounds(perActivity, mode) function formatBound(value: number): string { if (bounds.unit === 'percent') return formatPercent(value, value % 1 === 0 ? 0 : 1) return formatCurrency(value, currency) } return (