import { AlternativeHotelsPage as AlternativeHotelsPagePrimitive } from "@scandic-hotels/booking-flow/pages/AlternativeHotelsPage"

import TrackingSDK from "@/components/TrackingSDK"
import { getLang } from "@/i18n/serverContext"

import { type LangParams, type PageArgs } from "@/types/params"

export default async function AlternativeHotelsPage(
  props: PageArgs<LangParams>
) {
  const searchParams = await props.searchParams
  const lang = await getLang()

  return (
    <AlternativeHotelsPagePrimitive
      lang={lang}
      searchParams={searchParams}
      renderTracking={(props) => (
        <TrackingSDK
          hotelInfo={props.hotelsTrackingData}
          pageData={props.pageTrackingData}
        />
      )}
    />
  )
}
