import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType" import { alternativeHotels } from "@/constants/routes/hotelReservation" import Alert from "@/components/TempDesignSystem/Alert" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" import type { NoAvailabilityAlertProp } from "@/types/components/hotelReservation/selectHotel/noAvailabilityAlert" export default async function NoAvailabilityAlert({ hotelsLength, bookingCode, isAllUnavailable, isAlternative, isBookingCodeRateNotAvailable, operaId, }: NoAvailabilityAlertProp) { const intl = await getIntl() const lang = await getLang() if (bookingCode && isBookingCodeRateNotAvailable) { const bookingCodeText = intl.formatMessage( { defaultMessage: "We found no available rooms using this booking code ({bookingCode}). See available rates below.", }, { bookingCode } ) return ( ) } if (!isAllUnavailable) { return null } if (hotelsLength === 1 && !isAlternative && operaId) { return ( ) } return ( ) }