import { useIntl } from "react-intl" import { getSingleDecimal } from "@scandic-hotels/common/utils/numberFormatting" import ButtonLink from "@scandic-hotels/design-system/ButtonLink" import { Divider } from "@scandic-hotels/design-system/Divider" import { FacilityToIcon } from "@scandic-hotels/design-system/FacilityToIcon" import HotelLogoIcon from "@scandic-hotels/design-system/Icons/HotelLogoIcon" import ImageGallery from "@scandic-hotels/design-system/ImageGallery" import { TripAdvisorChip } from "@scandic-hotels/design-system/TripAdvisorChip" import { Typography } from "@scandic-hotels/design-system/Typography" import { mapApiImagesToGalleryImages } from "@/utils/imageGallery" import styles from "./hotelListingItem.module.css" import type { HotelListingHotelData } from "@scandic-hotels/trpc/types/hotel" interface HotelListingItemProps { hotel: HotelListingHotelData["hotel"] url: string | null } export default function HotelListingItem({ hotel, url, }: HotelListingItemProps) { const intl = useIntl() const galleryImages = mapApiImagesToGalleryImages(hotel.galleryImages) const tripadvisorRating = hotel.tripadvisor const address = `${hotel.address.streetAddress}, ${hotel.address.city}` const amenities = hotel.detailedFacilities.slice(0, 5) const hotelDescription = hotel.description return (
{tripadvisorRating ? ( ) : null}

{hotel.name}

{address} {intl.formatMessage( { id: "common.kmToCityCenter", defaultMessage: "{number} km to city center", }, { number: getSingleDecimal( hotel.location.distanceToCentre / 1000 ), } )}
{hotelDescription ? (

{hotelDescription}

) : null}
    {amenities.map((amenity) => { return (
  • {amenity.name}
  • ) })}
{url ? (
{intl.formatMessage({ id: "destination.seeHotelDetails", defaultMessage: "See hotel details", })}
) : null}
) }