"use client"; import { MapContainer, Marker, Popup, TileLayer } from "react-leaflet"; import L from "leaflet"; import "leaflet/dist/leaflet.css"; import type { CitySummary } from "@/lib/types"; type MapCanvasProps = { cities: CitySummary[]; selectedCity: string | null; onSelectCity: (cityName: string) => void; }; function shortName(name: string) { return name.length > 8 ? `${name.slice(0, 7)}.` : name; } const tempIcon = ( city: CitySummary, selected: boolean, ) => L.divIcon({ className: "", html: `
{city.display_name}
Risk: {city.risk_level}
{selectedCity === city.name ? "Selected" : "Click to open"}