import { env } from "@/env/server"

import BookingWidget, { preload } from "@/components/BookingWidget"

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

export default async function BookingWidgetPage({
  searchParams,
}: PageArgs<{}, URLSearchParams>) {
  if (!env.ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH) {
    return null
  }

  preload()

  return <BookingWidget searchParams={searchParams} />
}
