import { getHotel } from "@/lib/trpc/memoizedRequests"

import SidePeek from "@/components/HotelReservation/SidePeek"

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

export default async function HotelSidePeek({
  params,
  searchParams,
}: PageArgs<LangParams, { hotel: string }>) {
  if (!searchParams.hotel) {
    return <SidePeek hotel={null} />
  }

  const hotel = await getHotel({
    hotelId: searchParams.hotel,
    language: params.lang,
    isCardOnlyPayment: false,
  })

  return <SidePeek hotel={hotel} />
}
