import { Marker, Popup } from 'react-leaflet'; import BentoMapContainer from './BentoMapContainer'; import type { PointMapProps } from '../../types/mapTypes'; const BentoPointMap = ({ height, center, zoom, tileLayer, data, onClick, renderPopupBody }: PointMapProps) => { return ( {data.map((point, i) => { const { coordinates, title } = point; // We expect points in [long, lat] order (consistent with GeoJSON), but Leaflet wants them in [lat, long]. const coordinatesLatLongOrder: [number, number] = [coordinates[1], coordinates[0]]; return (

{onClick ? ( { onClick(point); e.preventDefault(); }} > {title} ) : ( <>{title} )}

{renderPopupBody ? renderPopupBody(point) : null}
); })}
); }; export default BentoPointMap;