import { dt } from "@/lib/dt" import { CheckCircleIcon, DirectionsIcon, EmailIcon, LinkIcon, } from "@/components/Icons" import CrossCircleIcon from "@/components/Icons/CrossCircle" import IconChip from "@/components/TempDesignSystem/IconChip" import Body from "@/components/TempDesignSystem/Text/Body" import Caption from "@/components/TempDesignSystem/Text/Caption" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { Toast } from "@/components/TempDesignSystem/Toasts" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" import { formatPrice } from "@/utils/numberFormatting" import SummaryCard from "./SummaryCard" import styles from "./bookingSummary.module.css" import type { Hotel } from "@/types/hotel" import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation" interface BookingSummaryProps { booking: BookingConfirmation["booking"] hotel: Hotel } export default async function BookingSummary({ booking, hotel, }: BookingSummaryProps) { const intl = await getIntl() const lang = getLang() const directionsUrl = `https://www.google.com/maps/dir/?api=1&destination=${hotel.location.latitude},${hotel.location.longitude}` const isPaid = booking.rateDefinition.cancellationRule !== "CancellableBefore6PM" const bookingDate = dt(booking.createDateTime) .locale(lang) .format("D MMMM YYYY") return (
{intl.formatMessage({ id: "Booking summary" })}
) : ( ) } > {intl.formatMessage({ id: "Status" })}:{" "} {isPaid ? intl.formatMessage({ id: "Paid" }) : intl.formatMessage({ id: "Unpaid" })} } /> , }, { href: `mailto:${hotel.contactInformation.email}`, text: intl.formatMessage({ id: "Email" }), icon: , }, { href: hotel.contactInformation.websiteUrl, text: intl.formatMessage({ id: "Homepage" }), icon: , }, ]} />
{hotel.specialAlerts.length > 0 && (
    {hotel.specialAlerts.map((alert) => (
  • {alert.text}
  • ))}
)}
) }