"use client" import { useIntl } from "react-intl" import { MaterialIcon } from "@scandic-hotels/design-system/Icons" import { Typography } from "@scandic-hotels/design-system/Typography" import { dt } from "@/lib/dt" import { useMyStayRoomDetailsStore } from "@/stores/my-stay/myStayRoomDetailsStore" import IconChip from "@/components/TempDesignSystem/IconChip" import { Toast } from "@/components/TempDesignSystem/Toasts" import useLang from "@/hooks/useLang" import { trackMyStayPageLink } from "@/utils/tracking" import TotalPrice from "../Rooms/TotalPrice" import SummaryCard from "./SummaryCard" import styles from "./bookingSummary.module.css" import type { Hotel } from "@/types/hotel" interface BookingSummaryProps { hotel: Hotel } export default function BookingSummary({ hotel }: BookingSummaryProps) { const intl = useIntl() const lang = useLang() const bookedRoom = useMyStayRoomDetailsStore((state) => state.bookedRoom) const { isCancelled, createDateTime, guaranteeInfo, priceType } = bookedRoom const directionsUrl = `https://www.google.com/maps/dir/?api=1&destination=${hotel.location.latitude},${hotel.location.longitude}` const bookingDate = dt(createDateTime).locale(lang).format("D MMMM YYYY") const isPaid = !!guaranteeInfo const paymentMethod = guaranteeInfo?.paymentMethodDescription ?.toLocaleLowerCase() .startsWith("visa") ? intl.formatMessage({ id: "Card" }) : guaranteeInfo?.paymentMethodDescription ? guaranteeInfo?.paymentMethodDescription : intl.formatMessage({ id: "N/A" }) return (

{intl.formatMessage({ id: "Booking summary" })}

} image={{ src: "/_static/img/scandic-coin.svg", alt: "Scandic coin", }} texts={[`${intl.formatMessage({ id: "Payment" })}: ${paymentMethod}`]} supportingText={bookingDate} chip={ isCancelled ? ( } > {intl.formatMessage({ id: "Cancelled" })} ) : ( ) : ( ) } > {intl.formatMessage({ id: "Status" })}:{" "} {isPaid ? intl.formatMessage({ id: "Paid" }) : intl.formatMessage({ id: "Unpaid" })} ) } />

{hotel.name}

} image={{ src: "/_static/img/scandic-service.svg", alt: "Scandic service", }} texts={[ hotel.address.streetAddress, `${hotel.address.zipCode} ${hotel.address.city}`, ]} supportingText={intl.formatMessage( { id: "Long {long} ∙ Lat {lat}" }, { lat: hotel.location.latitude, long: hotel.location.longitude, } )} links={[ { href: directionsUrl, text: intl.formatMessage({ id: "Directions" }), icon: ( ), onClick: () => trackMyStayPageLink("see on map"), }, { href: `mailto:${hotel.contactInformation.email}`, text: intl.formatMessage({ id: "Email" }), icon: ( ), onClick: () => trackMyStayPageLink("email us"), }, { href: hotel.contactInformation.websiteUrl, text: intl.formatMessage({ id: "Homepage" }), icon: ( ), onClick: () => trackMyStayPageLink("hotel homepage"), }, ]} />
{hotel.specialAlerts.length > 0 && (
    {hotel.specialAlerts.map((alert) => (
  • {alert.text}
  • ))}
)}
) }