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
}
