Files
web/apps/scandic-web/components/BookingWidget/index.tsx
Joakim Jäderberg f36b90e474 Merged in feature/bookingwidget-client-side (pull request #1481)
Move more of BookingWidget to client SW-1639

* feat: move getLocations in booking widget to client side so that it's also cached on the client reducing the blinking when switching urls (and reducing duplicate calls)


Approved-by: Linus Flood
2025-03-05 13:37:33 +00:00

24 lines
513 B
TypeScript

import { isBookingWidgetHidden } from "@/lib/trpc/memoizedRequests"
import BookingWidgetClient from "./Client"
import type { BookingWidgetProps } from "@/types/components/bookingWidget"
export default async function BookingWidget({
type,
bookingWidgetSearchParams,
}: BookingWidgetProps) {
const isHidden = await isBookingWidgetHidden()
if (isHidden) {
return null
}
return (
<BookingWidgetClient
type={type}
bookingWidgetSearchParams={bookingWidgetSearchParams}
/>
)
}