"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 useSetOverflowVisibleOnRA from "@scandic-hotels/common/hooks/useSetOverflowVisibleOnRA" import { Button } from "@scandic-hotels/design-system/Button" import Checkbox from "@scandic-hotels/design-system/Form/Checkbox" 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 PaymentOptionsGroup from "../../Payment/PaymentOptionsGroup" import styles from "./guarantee.module.css" import type { CreditCard } from "@scandic-hotels/trpc/types/user" interface GuaranteeProps { savedCreditCards: CreditCard[] | null } export default function Guarantee({ savedCreditCards }: GuaranteeProps) { const intl = useIntl() const guarantee = useWatch({ name: "guarantee" }) return (