import { Suspense } from "react"

import MyStay from "@/components/HotelReservation/MyStay"
import { MyStaySkeleton } from "@/components/HotelReservation/MyStay/myStaySkeleton"
import { setLang } from "@/i18n/serverContext"

import Tracking from "./tracking"

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

export default async function MyStayWebviewPage(
  props: PageArgs<LangParams, { RefId?: string }>
) {
  const searchParams = await props.searchParams
  const params = await props.params
  setLang(params.lang)
  const refId = searchParams.RefId

  return (
    <Suspense fallback={<MyStaySkeleton />}>
      <MyStay refId={refId} lang={params.lang} isWebview={true} />
      <Tracking />
    </Suspense>
  )
}
