"use client"; import type { OverlayMode } from "./location-score-panel"; import type { BaseOverlay } from "./map-view"; interface MapLegendProps { overlayMode: OverlayMode; baseOverlay: BaseOverlay; threshold: number; hasPinData: boolean; } // Shared score ramp stops — matches makeColorExpr in map-view.tsx const SCORE_STOPS: [number, string][] = [ [0, "#d73027"], [0.25, "#fc8d59"], [0.5, "#fee08b"], [0.75, "#d9ef8b"], [1, "#1a9850"], ]; function gradientCss(stops: [number, string][]): string { return `linear-gradient(to right, ${stops.map(([p, c]) => `${c} ${p * 100}%`).join(", ")})`; } export function MapLegend({ overlayMode, baseOverlay, threshold, hasPinData }: MapLegendProps) { if (overlayMode === "isochrone" && hasPinData) { // Travel-time legend: green (near) → red (far) const stops: [number, string][] = [ [0, "#1a9850"], [0.5, "#fee08b"], [1, "#d73027"], ]; return (