feat(SW-1389): refactor page settings
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { getLocations, getSiteConfig } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
import {
|
||||
getLocations,
|
||||
isBookingWidgetHidden,
|
||||
} from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import BookingWidgetClient from "./Client"
|
||||
|
||||
@@ -14,11 +15,15 @@ export default async function BookingWidget({
|
||||
type,
|
||||
bookingWidgetSearchParams,
|
||||
}: BookingWidgetProps) {
|
||||
const lang = await getLang()
|
||||
const locations = await getLocations()
|
||||
const siteConfig = await getSiteConfig(lang)
|
||||
const isHidden = await isBookingWidgetHidden()
|
||||
|
||||
if (!locations || "error" in locations || siteConfig?.bookingWidgetDisabled) {
|
||||
if (isHidden) {
|
||||
return null
|
||||
}
|
||||
|
||||
const locations = await getLocations()
|
||||
|
||||
if (!locations || "error" in locations) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user