import { useEffect, useState } from 'react' import { Navigation } from 'lucide-react' import type mapboxgl from 'mapbox-gl' /** * Round compass pill for the Mapbox planner map. The Mapbox map can be rotated and * pitched, so this shows the current bearing (the arrow points to north) and snaps * the camera back to north + flat on click. Rendered next to the POI "explore" pill * (Mapbox only) and built as the SAME frosted shell (padding 4 around a 34px button) * so its height and transparency match the POI pill exactly. */ export function MapCompassPill({ map }: { map: mapboxgl.Map }) { const [bearing, setBearing] = useState(() => map.getBearing()) useEffect(() => { const update = () => setBearing(map.getBearing()) update() map.on('rotate', update) return () => { map.off('rotate', update) } }, [map]) return (