38 lines
767 B
TypeScript
38 lines
767 B
TypeScript
"use client"
|
|
|
|
import { trpc } from "@/lib/trpc/client"
|
|
|
|
import RouterTransition from "@/components/TrackingSDK/RouterTransition"
|
|
|
|
import type {
|
|
TrackingSDKHotelInfo,
|
|
TrackingSDKPageData,
|
|
TrackingSDKPaymentInfo,
|
|
} from "@/types/components/tracking"
|
|
|
|
export default function TrackingSDK({
|
|
pageData,
|
|
hotelInfo,
|
|
paymentInfo,
|
|
}: {
|
|
pageData: TrackingSDKPageData
|
|
hotelInfo?: TrackingSDKHotelInfo
|
|
paymentInfo?: TrackingSDKPaymentInfo
|
|
}) {
|
|
const { data: userTrackingData, isPending } =
|
|
trpc.user.userTrackingInfo.useQuery()
|
|
|
|
if (isPending || !userTrackingData) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<RouterTransition
|
|
pageData={pageData}
|
|
userData={userTrackingData}
|
|
hotelInfo={hotelInfo}
|
|
paymentInfo={paymentInfo}
|
|
/>
|
|
)
|
|
}
|