"use client" import { useIntl } from "react-intl" import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data" import { PriceTagIcon, ScandicLogoIcon } from "@/components/Icons" import TripAdvisorIcon from "@/components/Icons/TripAdvisor" import Button from "@/components/TempDesignSystem/Button" import Chip from "@/components/TempDesignSystem/Chip" import Link from "@/components/TempDesignSystem/Link" import Caption from "@/components/TempDesignSystem/Text/Caption" import Footnote from "@/components/TempDesignSystem/Text/Footnote" import Title from "@/components/TempDesignSystem/Text/Title" import ReadMore from "../ReadMore" import ImageGallery from "../SelectRate/ImageGallery" import { hotelCardVariants } from "./variants" import styles from "./hotelCard.module.css" import { HotelCardListingType } from "@/types/components/hotelReservation/selectHotel/hotelCardListingProps" import type { HotelCardProps } from "@/types/components/hotelReservation/selectHotel/hotelCardProps" export default function HotelCard({ hotel, type = HotelCardListingType.PageListing, }: HotelCardProps) { const intl = useIntl() const { hotelData } = hotel const { price } = hotel const amenities = hotelData.detailedFacilities.slice(0, 5) const classNames = hotelCardVariants({ type, }) return (
{hotelData.gallery && ( )}
{hotelData.ratings?.tripAdvisor.rating}
{hotelData.name} {`${hotelData.address.streetAddress}, ${hotelData.address.city}`} {`${hotelData.location.distanceToCentre} ${intl.formatMessage({ id: "km to city center" })}`}
{amenities.map((facility) => { const IconComponent = mapFacilityToIcon(facility.id) return (
{IconComponent && } {facility.name}
) })}
{intl.formatMessage({ id: "Public price from" })} {price?.regularAmount} {price?.currency} / {intl.formatMessage({ id: "night" })} approx 280 eur
{intl.formatMessage({ id: "Member price from" })} {price?.memberAmount} {price?.currency} / {intl.formatMessage({ id: "night" })} approx 280 eur
) }