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
24 lines
691 B
TypeScript
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
|
|
}
|