Files
web/components/BookingWidget/index.tsx
2024-10-25 09:16:50 +02:00

29 lines
569 B
TypeScript

import { getLocations } from "@/lib/trpc/memoizedRequests"
import BookingWidgetClient from "./Client"
import type { BookingWidgetProps } from "@/types/components/bookingWidget"
export function preload() {
void getLocations()
}
export default async function BookingWidget({
type,
searchParams,
}: BookingWidgetProps) {
const locations = await getLocations()
if (!locations || "error" in locations) {
return null
}
return (
<BookingWidgetClient
locations={locations.data}
type={type}
searchParams={searchParams}
/>
)
}