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
24 lines
513 B
TypeScript
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}
|
|
/>
|
|
)
|
|
}
|