Files
web/packages/booking-flow/lib/utils/getRoomFeatureDescription.ts
Hrishikesh Vaipurkar a5790ee454 Merged in chore/SW-2878-extract-booking-confirmation-pag (pull request #2779)
Chore/SW-2878 extract booking confirmation pag

* chore(SW-2878): Moved booking confirmation page to booking-flow package

* chore(SW-2878): Fixed promo styles as per design

* chore(SW-2878): Kept tiny duplicate function to avoid export from booking-flow package


Approved-by: Anton Gunnarsson
2025-09-10 07:50:48 +00:00

24 lines
691 B
TypeScript

import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
import type { IntlShape } from "react-intl"
export function getFeatureDescription(
code: string,
description: string,
intl: IntlShape
): string {
const roomFeatureDescriptions: Record<string, string> = {
[RoomPackageCodeEnum.ACCESSIBILITY_ROOM]: intl.formatMessage({
defaultMessage: "Accessible room",
}),
[RoomPackageCodeEnum.ALLERGY_ROOM]: intl.formatMessage({
defaultMessage: "Allergy-friendly room",
}),
[RoomPackageCodeEnum.PET_ROOM]: intl.formatMessage({
defaultMessage: "Pet-friendly room",
}),
}
return roomFeatureDescriptions[code] ?? description
}