"use client" import { useState } from "react" import { useFormContext } from "react-hook-form" import { useIntl } from "react-intl" import { Button } from "@scandic-hotels/design-system/Button" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { Typography } from "@scandic-hotels/design-system/Typography" import { PaymentMethodEnum } from "@/constants/booking" import Modal from "@/components/Modal" import Divider from "@/components/TempDesignSystem/Divider" import Checkbox from "@/components/TempDesignSystem/Form/Checkbox" import { trackPaymentSectionOpen } from "@/utils/tracking/booking" import MySavedCards from "../Payment/MySavedCards" import PaymentOption from "../Payment/PaymentOption" import PaymentOptionsGroup from "../Payment/PaymentOptionsGroup" import TermsAndConditions from "../Payment/TermsAndConditions" import styles from "./confirm.module.css" import type { CreditCard } from "@/types/user" interface ConfirmBookingProps { savedCreditCards: CreditCard[] | null } export default function ConfirmBooking({ savedCreditCards, }: ConfirmBookingProps) { const intl = useIntl() const [isModalOpen, setModalOpen] = useState(false) const { watch } = useFormContext() const guarantee = watch("guarantee") return (
{ if (e.target.value) { trackPaymentSectionOpen() } }, }} />

{intl.formatMessage({ defaultMessage: "Guarantee room for late arrival", })}

setModalOpen(false)}>

{intl.formatMessage({ defaultMessage: "Guarantee for late arrival", })}

{intl.formatMessage({ defaultMessage: "When guaranteeing your booking with a credit card, we will hold the booking until 07:00 the day after check-in.", })}

{intl.formatMessage({ defaultMessage: "In case of a no-show, your credit card will be charged for the first night.", })}

{intl.formatMessage({ defaultMessage: "I may arrive later than 18:00 and want to guarantee my booking with a credit card.", })}

{savedCreditCards?.length && guarantee ? ( ) : null} {guarantee ? ( ) : null}
) } export function ConfirmBookingRedemption() { const intl = useIntl() return (

{intl.formatMessage({ defaultMessage: "When you confirm the booking the room will be guaranteed for late arrival. If you fail to arrive without cancelling in advance or if you cancel after 18:00 local time, you will be charged for one reward night.", })}

) }