diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(confirmation)/booking-confirmation/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(confirmation)/booking-confirmation/page.tsx index ab67751d3..02e02ee81 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(confirmation)/booking-confirmation/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(confirmation)/booking-confirmation/page.tsx @@ -5,6 +5,7 @@ import { getBookingConfirmation } from "@/lib/trpc/memoizedRequests" import BookingConfirmation from "@/components/HotelReservation/BookingConfirmation" import type { LangParams, PageArgs } from "@/types/params" +import { MEMBERSHIP_FAILED_ERROR } from "@/constants/booking" export default async function BookingConfirmationPage({ searchParams, @@ -17,5 +18,13 @@ export default async function BookingConfirmationPage({ void getBookingConfirmation(refId) - return + const membershipFailedError = + searchParams.errorCode === MEMBERSHIP_FAILED_ERROR + + return ( + + ) } diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Alerts/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Alerts/index.tsx deleted file mode 100644 index bb603c71a..000000000 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Alerts/index.tsx +++ /dev/null @@ -1,52 +0,0 @@ -"use client" - -import { useSearchParams } from "next/navigation" -import { useIntl } from "react-intl" - -import { MEMBERSHIP_FAILED_ERROR } from "@/constants/booking" - -import Alert from "@/components/TempDesignSystem/Alert" - -import type { BookingConfirmationAlertsProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation" -import { AlertTypeEnum } from "@/types/enums/alert" - -export default function Alerts({ booking }: BookingConfirmationAlertsProps) { - const intl = useIntl() - const searchParams = useSearchParams() - - 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 && ( - - )} - - ) -} diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/index.tsx index 399df125a..38a10b7e8 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/index.tsx @@ -13,7 +13,6 @@ import Divider from "@/components/TempDesignSystem/Divider" import { getIntl } from "@/i18n" import BookingConfirmationProvider from "@/providers/BookingConfirmationProvider" -import Alerts from "./Alerts" import Confirmation from "./Confirmation" import Tracking from "./Tracking" import { mapRoomState } from "./utils" @@ -21,9 +20,11 @@ import { mapRoomState } from "./utils" import styles from "./bookingConfirmation.module.css" import type { BookingConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation" +import { AlertTypeEnum } from "@/types/enums/alert" export default async function BookingConfirmation({ refId, + membershipFailedError, }: BookingConfirmationProps) { const bookingConfirmation = await getBookingConfirmation(refId) @@ -54,7 +55,18 @@ export default async function BookingConfirmation({ >
- + {membershipFailedError && ( + + )}