feat(SW-3642): Enable SAS EB payments * Wip add SAS eb payment * Add validate payment call * Check booking status payment method to determine validation * Clean up getPaymentData * Fix PartnerPoints casing * Add comment for validatePartnerPayment error handling * Remove comment Approved-by: Joakim Jäderberg
58 lines
1.7 KiB
TypeScript
58 lines
1.7 KiB
TypeScript
import { SelectHotelPage as SelectHotelPagePrimitive } from "@scandic-hotels/booking-flow/pages/SelectHotelPage"
|
|
import { AlertTypeEnum } from "@scandic-hotels/common/constants/alert"
|
|
import { toCapitalCase } from "@scandic-hotels/common/utils/toCapitalCase"
|
|
import { Alert } from "@scandic-hotels/design-system/Alert"
|
|
|
|
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
|
|
|
import { getIntl } from "@/i18n"
|
|
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 SelectHotelPage(props: PageArgs<LangParams>) {
|
|
const searchParams = await props.searchParams
|
|
const lang = await getLang()
|
|
const intl = await getIntl()
|
|
|
|
return (
|
|
<SelectHotelPagePrimitive
|
|
lang={lang}
|
|
searchParams={searchParams}
|
|
config={bookingFlowConfig}
|
|
topSlot={
|
|
bookingFlowConfig.redemptionType !== "disabled" ? (
|
|
<Alert
|
|
heading={intl.formatMessage({
|
|
id: "selectHotel.earnEuroBonusPointsAlert.heading",
|
|
defaultMessage: "Earn & use EuroBonus points",
|
|
})}
|
|
text={intl.formatMessage({
|
|
id: "selectHotel.earnEuroBonusPointsAlert.text",
|
|
defaultMessage:
|
|
"Collect new points with every booking, or use your current points to pay for hotel stays.",
|
|
})}
|
|
type={AlertTypeEnum.Info}
|
|
/>
|
|
) : undefined
|
|
}
|
|
/>
|
|
)
|
|
}
|