import { Suspense } from "react"

import SelectHotel from "@/components/HotelReservation/SelectHotel"
import { SelectHotelSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelSkeleton"
import { setLang } from "@/i18n/serverContext"

import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
import type { LangParams, PageArgs } from "@/types/params"

export default async function SelectHotelPage({
  params,
  searchParams,
}: PageArgs<LangParams, SelectHotelSearchParams>) {
  setLang(params.lang)

  return (
    <Suspense
      key={JSON.stringify(searchParams)}
      fallback={<SelectHotelSkeleton />}
    >
      <SelectHotel params={params} searchParams={searchParams} />
    </Suspense>
  )
}
