"use client"; import { X, ExternalLink, Clock, Zap, MapPin, Building2, Truck } from "lucide-react"; import type { ChargeFeature, EnrichedConnector, EnrichedLocation } from "@/types/charging"; import { formatConnectorStandard, formatPowerType, statusColorClass, statusLabel } from "@/lib/connectorLabels"; import UsageChart from "@/components/UsageChart"; const fmtPrice = (v: number) => v.toLocaleString("nl-NL", { style: "currency", currency: "EUR", minimumFractionDigits: 2, maximumFractionDigits: 3 }); // Prefer the price baked by the pipeline; fall back to a best-effort parse of the // raw tariff (for data generated before the price field existed). function connectorPriceKwh(c: EnrichedConnector): number | null { if (typeof c.priceKwh === "number") return c.priceKwh; for (const t of c.tariffs ?? []) { for (const el of t.elements ?? []) { const energy = el.price_components?.find((pc) => pc.type === "ENERGY"); if (energy && typeof energy.price === "number") return energy.price; } } return null; } interface Props { selected: ChargeFeature | null; detail: EnrichedLocation | null; loading: boolean; slug?: string; // gemeente slug for usage history (undefined / 'nederland' = no chart) onClose: () => void; onJumpToGemeente?: () => void; } export default function LocationDetailPanel({ selected, detail, loading, slug, onClose, onJumpToGemeente }: Props) { if (!selected) return null; const p = selected.properties; const isFreight = p.layer === "freight"; return (
Geen gedetailleerde informatie geladen voor deze locatie {p.maxPowerKw > 0 ? ` (max. ${p.maxPowerKw} kW).` : "."}
{onJumpToGemeente && ( )}