import { SelectRatePage as SelectRatePagePrimitive } from "@scandic-hotels/booking-flow/pages/SelectRatePage"

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

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

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

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