"use client" import { useLayoutEffect } from "react" import { Dialog, DialogTrigger, Modal, ModalOverlay, } from "react-aria-components" import { useWatch } from "react-hook-form" import { useIntl } from "react-intl" import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod" 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 MySavedCards from "@/components/HotelReservation/MySavedCards" import PaymentOption from "@/components/HotelReservation/PaymentOption" import Checkbox from "@/components/TempDesignSystem/Form/Checkbox" import useSetOverflowVisibleOnRA from "@/hooks/useSetOverflowVisibleOnRA" import PaymentOptionsGroup from "../../Payment/PaymentOptionsGroup" import styles from "./guarantee.module.css" import type { CreditCard } from "@/types/user" interface GuaranteeProps { savedCreditCards: CreditCard[] | null } export default function Guarantee({ savedCreditCards }: GuaranteeProps) { const intl = useIntl() const guarantee = useWatch({ name: "guarantee" }) return (