import { AdvancedMarker, AdvancedMarkerAnchorPoint, InfoWindow, } from "@vis.gl/react-google-maps" import { useCallback } from "react" import { useMediaQuery } from "usehooks-ts" import { useHotelsMapStore } from "@/stores/hotels-map" import StandaloneHotelCardDialog from "@/components/HotelReservation/HotelCardDialog/StandaloneHotelCardDialog" import { trackEvent } from "@/utils/tracking/base" import HotelPin from "./HotelPin" import styles from "./hotelListingMapContent.module.css" import type { HotelListingMapContentProps } from "@/types/components/hotelReservation/selectHotel/map" function HotelListingMapContent({ hotelPins }: HotelListingMapContentProps) { const { activeHotel, hoveredHotel, activate, deactivate, engage, disengage } = useHotelsMapStore() const isDesktop = useMediaQuery("(min-width: 768px)") const toggleActiveHotelPin = useCallback( (pinName: string | null, hotelId: string) => { if (activeHotel === pinName || pinName === null) { deactivate() return } trackEvent({ event: "hotelClickMap", map: { action: "hotel click - map", }, hotelInfo: { hotelId, }, }) activate(pinName) }, [activeHotel, activate, deactivate] ) return (