'use client' import { useState } from 'react' import { useIntl } from 'react-intl' import { selectRate } from '@scandic-hotels/common/constants/routes/hotelReservation' import Body from '../../../Body' import Caption from '../../../Caption' import Footnote from '../../../Footnote' import { IconButton } from '../../../IconButton' import { MaterialIcon } from '../../../Icons/MaterialIcon' import Link from '../../../Link' import { OldDSButton as Button } from '../../../OldDSButton' import Subtitle from '../../../Subtitle' import { Typography } from '../../../Typography' import { NoPriceAvailableCard } from '../../NoPriceAvailableCard' import { HotelCardDialogImage } from '../../HotelCardDialogImage' import styles from './standaloneHotelCardDialog.module.css' import { Lang } from '@scandic-hotels/common/constants/language' import { HotelPin } from '../../../Map/types' import { FacilityToIcon } from '../../../FacilityToIcon' import { HotelPointsRow } from '../../HotelPointsRow' interface StandaloneHotelCardProps { data: HotelPin lang: Lang isUserLoggedIn: boolean handleClose: () => void onClick?: () => void } export function StandaloneHotelCardDialog({ data, lang, handleClose, isUserLoggedIn, onClick, }: StandaloneHotelCardProps) { const intl = useIntl() const [imageError, setImageError] = useState(false) const { name, chequePrice, publicPrice, memberPrice, redemptionPrice, voucherPrice, currency, amenities, image, ratings, operaId, hasEnoughPoints, } = data const notEnoughPointsLabel = intl.formatMessage({ defaultMessage: 'Not enough points', }) const shouldShowNotEnoughPoints = redemptionPrice && !hasEnoughPoints return (