feat(SW-3494): removed properties that we dont need in the tracking * feat(SW-3494): removed properties that we dont need in the tracking * Fixed waiting on user response before tracking * Refactor and cleanup * Cleanup Approved-by: Joakim Jäderberg
46 lines
835 B
TypeScript
46 lines
835 B
TypeScript
"use client"
|
|
|
|
import { usePathname } from "next/navigation"
|
|
|
|
import { useTrackHardNavigation } from "./useTrackHardNavigation"
|
|
import { useTrackSoftNavigation } from "./useTrackSoftNavigation"
|
|
|
|
import type {
|
|
TrackingSDKAncillaries,
|
|
TrackingSDKHotelInfo,
|
|
TrackingSDKPageData,
|
|
TrackingSDKPaymentInfo,
|
|
} from "./types"
|
|
|
|
export function TrackingSDK({
|
|
pageData,
|
|
hotelInfo,
|
|
paymentInfo,
|
|
ancillaries,
|
|
}: {
|
|
pageData: TrackingSDKPageData
|
|
hotelInfo?: TrackingSDKHotelInfo
|
|
paymentInfo?: TrackingSDKPaymentInfo
|
|
ancillaries?: TrackingSDKAncillaries
|
|
}) {
|
|
const pathName = usePathname()
|
|
|
|
useTrackHardNavigation({
|
|
pageData,
|
|
hotelInfo,
|
|
paymentInfo,
|
|
ancillaries,
|
|
pathName,
|
|
})
|
|
|
|
useTrackSoftNavigation({
|
|
pageData,
|
|
hotelInfo,
|
|
paymentInfo,
|
|
ancillaries,
|
|
pathName,
|
|
})
|
|
|
|
return null
|
|
}
|