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 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 { FacilityToIcon } from "@/components/ContentType/HotelPage/data" import ImageGallery from "@/components/ImageGallery" 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 ? (
{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}
  • ) })}
{url ? (
{intl.formatMessage({ defaultMessage: "See hotel details", })}
) : null}
) }