"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 && (
)}
>
)
}