fix(SW-3551): Fix issue with BookingConfigProvider in RSC * wip move config to pages * Move config providing to pages
38 lines
967 B
TypeScript
38 lines
967 B
TypeScript
import { SelectHotelMapPage as SelectHotelMapPagePrimitive } from "@scandic-hotels/booking-flow/pages/SelectHotelMapPage"
|
|
import { toCapitalCase } from "@scandic-hotels/common/utils/toCapitalCase"
|
|
|
|
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
|
|
|
import { getLang } from "@/i18n/serverContext"
|
|
|
|
import type { Metadata } from "next"
|
|
|
|
import type { LangParams, PageArgs } from "@/types/params"
|
|
|
|
export async function generateMetadata({
|
|
searchParams,
|
|
}: PageArgs<LangParams>): Promise<Metadata> {
|
|
const { city } = await searchParams
|
|
|
|
if (!city || Array.isArray(city)) {
|
|
return {}
|
|
}
|
|
|
|
return {
|
|
title: `${toCapitalCase(city)}`,
|
|
}
|
|
}
|
|
|
|
export default async function SelectHotelMapPage(props: PageArgs<LangParams>) {
|
|
const searchParams = await props.searchParams
|
|
const lang = await getLang()
|
|
|
|
return (
|
|
<SelectHotelMapPagePrimitive
|
|
lang={lang}
|
|
searchParams={searchParams}
|
|
config={bookingFlowConfig}
|
|
/>
|
|
)
|
|
}
|