import React, { useContext, useMemo } from "react" import BoxMap from "../base/BoxMap" import ContextLanguage from "../../contexts/ContextLanguage" import { Marker, Popup } from "react-leaflet" import { Location } from "../../utils/location" import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer" export default function BoxVisualizationMap({ ...props }) { const { strings } = useContext(ContextLanguage) const { tweets, mapViewHook } = useContext(ContextRepositoryViewer) const markers = useMemo( () => { return tweets.filter(tweet => tweet.location).map(tweet => { const location = Location.fromTweet(tweet) return (

{tweet["content"]}

@{tweet["poster"]}

) }) }, [tweets], ) return ( {markers} ) }