fix(SW-1168) Fixed typing
This commit is contained in:
@@ -22,6 +22,7 @@ import { getVisibleHotels } from "./utils"
|
||||
|
||||
import styles from "./selectHotelMapContent.module.css"
|
||||
|
||||
import type { HotelData } from "@/types/components/hotelReservation/selectHotel/hotelCardListingProps"
|
||||
import type { SelectHotelMapProps } from "@/types/components/hotelReservation/selectHotel/map"
|
||||
|
||||
export default function SelectHotelContent({
|
||||
@@ -36,7 +37,7 @@ export default function SelectHotelContent({
|
||||
const map = useMap()
|
||||
|
||||
const isAboveMobile = useMediaQuery("(min-width: 768px)")
|
||||
const [visibleHotels, setVisibleHotels] = useState<any[]>([])
|
||||
const [visibleHotels, setVisibleHotels] = useState<HotelData[]>([])
|
||||
const [showBackToTop, setShowBackToTop] = useState<boolean>(false)
|
||||
const [isMapLoaded, setIsMapLoaded] = useState<boolean>(false)
|
||||
const listingContainerRef = useRef<HTMLDivElement | null>(null)
|
||||
|
||||
@@ -10,7 +10,7 @@ export function getVisibleHotelPins(
|
||||
const bounds = map.getBounds()
|
||||
if (!bounds) return []
|
||||
|
||||
return filteredHotelPins.filter((pin: any) => {
|
||||
return filteredHotelPins.filter((pin) => {
|
||||
const { lat, lng } = pin.coordinates
|
||||
return bounds.contains({ lat, lng })
|
||||
})
|
||||
@@ -22,8 +22,8 @@ export function getVisibleHotels(
|
||||
map: google.maps.Map | null
|
||||
) {
|
||||
const visibleHotelPins = getVisibleHotelPins(map, filteredHotelPins)
|
||||
const visibleHotels = hotels.filter((hotel: any) =>
|
||||
visibleHotelPins.some((pin: any) => pin.operaId === hotel.hotelData.operaId)
|
||||
const visibleHotels = hotels.filter((hotel) =>
|
||||
visibleHotelPins.some((pin) => pin.operaId === hotel.hotelData.operaId)
|
||||
)
|
||||
return visibleHotels
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user