import { Lang } from "@/constants/languages"
import { env } from "@/env/server"

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

import styles from "./page.module.css"

import {
  TrackingChannelEnum,
  TrackingSDKPageData,
} from "@/types/components/tracking"
import type { LangParams, PageArgs } from "@/types/params"

export default function HotelReservationPage({ params }: PageArgs<LangParams>) {
  setLang(params.lang)

  if (!env.ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH) {
    return null
  }

  const pageTrackingData: TrackingSDKPageData = {
    pageId: "hotelreservation",
    domainLanguage: params.lang as Lang,
    channel: TrackingChannelEnum["hotelreservation"],
    pageName: "hotelreservation",
    siteSections: "hotelreservation",
    pageType: "hotelreservationstartpage",
  }

  return (
    <div className={styles.page}>
      New booking flow! Please report errors/issues in Slack.
      <TrackingSDK pageData={pageTrackingData} />
    </div>
  )
}
