Feat/lokalise rebuild * chore(lokalise): update translation ids * chore(lokalise): easier to switch between projects * chore(lokalise): update translation ids * . * . * . * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * chore(lokalise): new translations * merge * switch to errors for missing id's * merge * sync translations Approved-by: Linus Flood
64 lines
1.4 KiB
TypeScript
64 lines
1.4 KiB
TypeScript
import { AlternativeHotelsPage as AlternativeHotelsPagePrimitive } from "@scandic-hotels/booking-flow/pages/AlternativeHotelsPage"
|
|
|
|
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
|
import { getHotel } from "@/lib/trpc/memoizedRequests/getHotel"
|
|
|
|
import { getIntl } from "@/i18n"
|
|
import { getLang } from "@/i18n/serverContext"
|
|
|
|
import type { Metadata } from "next"
|
|
|
|
import { type LangParams, type PageArgs } from "@/types/params"
|
|
|
|
export async function generateMetadata({
|
|
searchParams,
|
|
params,
|
|
}: PageArgs<LangParams>): Promise<Metadata> {
|
|
const intl = await getIntl()
|
|
|
|
const { hotel } = await searchParams
|
|
const { lang } = await params
|
|
|
|
if (!hotel || Array.isArray(hotel)) {
|
|
return {}
|
|
}
|
|
|
|
const hotelData = await getHotel({
|
|
hotelId: hotel,
|
|
language: lang,
|
|
isCardOnlyPayment: false,
|
|
})
|
|
const hotelName = hotelData?.additionalData?.name
|
|
|
|
if (!hotelName) {
|
|
return {}
|
|
}
|
|
|
|
const title = intl.formatMessage(
|
|
{
|
|
id: "alternativeHotels.title",
|
|
defaultMessage: "Alternatives for {value}",
|
|
},
|
|
{
|
|
value: hotelName,
|
|
}
|
|
)
|
|
|
|
return { title }
|
|
}
|
|
|
|
export default async function AlternativeHotelsPage(
|
|
props: PageArgs<LangParams>
|
|
) {
|
|
const searchParams = await props.searchParams
|
|
const lang = await getLang()
|
|
|
|
return (
|
|
<AlternativeHotelsPagePrimitive
|
|
lang={lang}
|
|
searchParams={searchParams}
|
|
config={bookingFlowConfig}
|
|
/>
|
|
)
|
|
}
|