import { useIntl } from "react-intl" import { Divider } from "@scandic-hotels/design-system/Divider" import HotelLogoIcon from "@scandic-hotels/design-system/Icons/HotelLogoIcon" import TripadvisorIcon from "@scandic-hotels/design-system/Icons/TripadvisorIcon" import { Typography } from "@scandic-hotels/design-system/Typography" import ButtonLink from "@/components/ButtonLink" import { FacilityToIcon } from "@/components/ContentType/HotelPage/data" import ImageGallery from "@/components/ImageGallery" import { mapApiImagesToGalleryImages } from "@/utils/imageGallery" import { getSingleDecimal } from "@/utils/numberFormatting" import styles from "./hotelListingItem.module.css" import type { Hotel } from "@scandic-hotels/trpc/types/hotel" interface HotelListingItemProps { hotel: Hotel url: string } export default function HotelListingItem({ hotel, url, }: HotelListingItemProps) { const intl = useIntl() const galleryImages = mapApiImagesToGalleryImages(hotel.galleryImages || []) const tripadvisorRating = hotel.ratings?.tripAdvisor.rating const address = `${hotel.address.streetAddress}, ${hotel.address.city}` const amenities = hotel.detailedFacilities.slice(0, 5) const hotelDescription = hotel.hotelContent.texts.descriptions?.short return (
{tripadvisorRating ? (
{tripadvisorRating}
) : null}

{hotel.name}

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

{hotelDescription}

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