import TripAdvisorChip from "@scandic-hotels/booking-flow/components/TripAdvisorChip" import { getSingleDecimal } from "@scandic-hotels/common/utils/numberFormatting" import { Divider } from "@scandic-hotels/design-system/Divider" import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer" import { Typography } from "@scandic-hotels/design-system/Typography" import { FacilityToIcon } from "@/components/ContentType/HotelPage/data" import ImageGallery from "@/components/ImageGallery" import Alert from "@/components/TempDesignSystem/Alert" import { getIntl } from "@/i18n" import { mapApiImagesToGalleryImages } from "@/utils/imageGallery" import ReadMore from "../../ReadMore" import { getHotelAlertsForBookingDates } from "../../utils" import HotelDescription from "./HotelDescription" import styles from "./hotelInfoCard.module.css" import type { HotelInfoCardProps } from "@/types/components/hotelReservation/selectRate/hotelInfoCard" import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek" export default async function HotelInfoCard({ booking, hotel, }: HotelInfoCardProps) { const intl = await getIntl() const sortedFacilities = hotel.detailedFacilities .sort((a, b) => b.sortOrder - a.sortOrder) .slice(0, 5) const galleryImages = mapApiImagesToGalleryImages(hotel.galleryImages || []) const specialAlerts = getHotelAlertsForBookingDates( hotel.specialAlerts, booking.fromDate, booking.toDate ) return (
{hotel.ratings?.tripAdvisor && ( )}

{hotel.name}

{intl.formatMessage( { defaultMessage: "{address}, {city} ∙ {distanceToCityCenterInKm} km to city center", }, { address: hotel.address.streetAddress, city: hotel.address.city, distanceToCityCenterInKm: getSingleDecimal( hotel.location.distanceToCentre / 1000 ), } )}

{hotel.hotelContent.texts.descriptions?.medium}

{sortedFacilities?.map((facility) => (

{facility.name}

))}
{specialAlerts.map((alert) => { return (
) })}
) } export function HotelInfoCardSkeleton() { return (

{[1, 2, 3, 4, 5]?.map((id) => { return (
) })}
) }