* fix(SW-2247): Removed accordion like special requests block and changed button variant * fix(SW-2247): Added additional info for bedtype selection Approved-by: Tobias Johansson Approved-by: Niclas Edenvin
26 lines
631 B
TypeScript
26 lines
631 B
TypeScript
import type { IntlShape } from "react-intl"
|
|
|
|
export function getBedTypeInfoText(
|
|
intl: IntlShape,
|
|
hasChildWithExtraBed: boolean,
|
|
hasMultipleBedTypes: boolean
|
|
) {
|
|
const availabilityText = intl.formatMessage({
|
|
defaultMessage: "Subject to availability",
|
|
})
|
|
|
|
const extraBedText = intl.formatMessage({
|
|
defaultMessage: "Extra bed will be provided additionally",
|
|
})
|
|
|
|
if (hasMultipleBedTypes && hasChildWithExtraBed) {
|
|
return `${availabilityText}. ${extraBedText}`
|
|
} else if (hasMultipleBedTypes) {
|
|
return availabilityText
|
|
} else if (hasChildWithExtraBed) {
|
|
return extraBedText
|
|
}
|
|
|
|
return null
|
|
}
|