Merged in feat/sw-3207-refactor-select-hotel-tracking (pull request #2587)

feat(SW-3207): Refactor select-hotel tracking

* Refactor select-hotel tracking


Approved-by: Bianca Widstam
This commit is contained in:
Anton Gunnarsson
2025-08-06 08:35:48 +00:00
parent 7fb082f712
commit 41efb3a7b3
9 changed files with 184 additions and 274 deletions

View File

@@ -13,24 +13,16 @@ import TrackingSDK from "@/components/TrackingSDK"
import useLang from "@/hooks/useLang"
import { getValidDates } from "../getValidDates"
import { getTracking } from "./tracking"
import type { ChildrenInRoom } from "@/utils/hotelSearchDetails"
import { getSelectRateTracking } from "./tracking"
export default function Tracking({
adultsInRoom,
childrenInRoom,
hotelId,
hotelName,
noOfRooms,
country,
city,
}: {
adultsInRoom: number[]
childrenInRoom: ChildrenInRoom
hotelId: string
hotelName: string
noOfRooms: number
country: string
city: string
}) {
@@ -47,22 +39,19 @@ export default function Tracking({
const arrivalDate = fromDate.toDate()
const departureDate = toDate.toDate()
const { hotelsTrackingData, pageTrackingData } = getTracking(
const { hotelsTrackingData, pageTrackingData } = getSelectRateTracking({
lang,
arrivalDate,
departureDate,
adultsInRoom,
childrenInRoom,
hotelId,
hotelName,
noOfRooms,
country,
city,
hotelCity: city,
paramCity,
bookingCode,
searchType === SEARCH_TYPE_REDEMPTION,
rooms
)
isRedemption: searchType === SEARCH_TYPE_REDEMPTION,
rooms,
})
return (
<TrackingSDK pageData={pageTrackingData} hotelInfo={hotelsTrackingData} />