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
28 lines
714 B
TypeScript
28 lines
714 B
TypeScript
import type { IntlShape } from "react-intl"
|
|
|
|
export function getBedTypeInfoText(
|
|
intl: IntlShape,
|
|
hasChildWithExtraBed: boolean,
|
|
hasMultipleBedTypes: boolean
|
|
) {
|
|
const availabilityText = intl.formatMessage({
|
|
id: "booking.subjectToAvailability",
|
|
defaultMessage: "Subject to availability",
|
|
})
|
|
|
|
const extraBedText = intl.formatMessage({
|
|
id: "enterDetails.room.extraBedText",
|
|
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
|
|
}
|