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 Image from "@scandic-hotels/design-system/Image" import { Typography } from "@scandic-hotels/design-system/Typography" import { getIntl } from "@/i18n" import styles from "./hotelListingItem.module.css" import type { HotelListingItemProps } from "@/types/components/contentPage/hotelListingItem" export default async function HotelListingItem({ hotelData, contentType = "hotel", }: HotelListingItemProps) { const intl = await getIntl() const { galleryImages, description, id, name, hotelType, location, address } = hotelData.hotel const image = galleryImages[0] const cta = contentType === "meeting" && hotelData.meetingUrl ? { url: hotelData.meetingUrl, openInNewTab: true, text: intl.formatMessage({ id: "meetingPackage.bookAMeeting", defaultMessage: "Book a meeting", }), } : { url: hotelData.url, openInNewTab: false, text: intl.formatMessage({ id: "destination.seeHotelDetails", defaultMessage: "See hotel details", }), } return (
{image.altText

{name}

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

{description}

{cta.url ? ( <> {cta.text} ) : null}
) }