(null)
- const membershipFailedError =
- searchParams.get("errorCode") === MEMBERSHIP_FAILED_ERROR
- const failedToVerifyMembership =
- booking.rateDefinition.isMemberRate && !booking.guest.membershipNumber
return (
-
- {/* Customer has manually entered a membership number for which verification failed */}
- {membershipFailedError && (
-
- )}
- {/* For some other reason membership could not be verified */}
- {!membershipFailedError && failedToVerifyMembership && (
-
- )}
-
-
-
-
-
-
-
-
-
-
+ {children}
)
}
diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/hotelDetails.module.css b/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/hotelDetails.module.css
index 484ae03e2..9f0a58a4a 100644
--- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/hotelDetails.module.css
+++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/hotelDetails.module.css
@@ -23,11 +23,6 @@
margin-top: var(--Spacing-x-half);
}
-.toast {
- align-self: flex-start;
- min-width: 300px;
-}
-
.list {
padding-left: var(--Spacing-x2);
}
diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/index.tsx
index 75f50fbb4..69859c8c1 100644
--- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/index.tsx
+++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/index.tsx
@@ -5,7 +5,6 @@ import { useIntl } from "react-intl"
import Link from "@/components/TempDesignSystem/Link"
import Body from "@/components/TempDesignSystem/Text/Body"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
-import { Toast } from "@/components/TempDesignSystem/Toasts"
import styles from "./hotelDetails.module.css"
@@ -68,13 +67,6 @@ export default function HotelDetails({
{hotel.contactInformation.websiteUrl}
-
-
-
- - {intl.formatMessage({ id: "N/A" })}
-
-
-
)
}
diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx
index 4353ee348..9398e1850 100644
--- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx
+++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx
@@ -1,24 +1,36 @@
-"use client"
-import { useIntl } from "react-intl"
-
import { dt } from "@/lib/dt"
+import { serverClient } from "@/lib/trpc/server"
import { CreditCardAddIcon } from "@/components/Icons"
import Button from "@/components/TempDesignSystem/Button"
import Body from "@/components/TempDesignSystem/Text/Body"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
-import useLang from "@/hooks/useLang"
+import { getIntl } from "@/i18n"
+import { getLang } from "@/i18n/serverContext"
import { formatPrice } from "@/utils/numberFormatting"
import styles from "./paymentDetails.module.css"
import type { BookingConfirmationPaymentDetailsProps } from "@/types/components/hotelReservation/bookingConfirmation/paymentDetails"
-export default function PaymentDetails({
+export default async function PaymentDetails({
booking,
}: BookingConfirmationPaymentDetailsProps) {
- const intl = useIntl()
- const lang = useLang()
+ const intl = await getIntl()
+ const lang = getLang()
+
+ const linkedReservations = await Promise.all(
+ // TODO: How to handle partial failure (e.g. one booking can't be fetched)? Need UX/UI
+ booking.linkedReservations.map(async (res) => {
+ const confirmation = await serverClient().booking.confirmation({
+ confirmationNumber: res.confirmationNumber,
+ })
+ return confirmation
+ })
+ )
+ const grandTotal = linkedReservations.reduce((acc, res) => {
+ return res ? acc + res.booking.totalPrice : acc
+ }, booking.totalPrice)
return (
@@ -29,11 +41,7 @@ export default function PaymentDetails({
{intl.formatMessage(
{ id: "{amount} has been paid" },
{
- amount: formatPrice(
- intl,
- booking.totalPrice,
- booking.currencyCode
- ),
+ amount: formatPrice(intl, grandTotal, booking.currencyCode),
}
)}