import { serverClient } from "@/lib/trpc/server"

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

export default async function BookingWidgetPage() {
  preload()

  // Get the booking widget show/hide status based on page specific settings
  const bookingWidgetToggle =
    await serverClient().contentstack.bookingwidget.toggle.get()

  if (bookingWidgetToggle.hideBookingWidget) {
    return null
  }

  return <BookingWidget type="full" />
}
