import { getSavedPaymentCardsSafely } from "@/lib/trpc/memoizedRequests"

import PaymentClient from "./PaymentClient"

import type { PaymentProps } from "@/types/components/hotelReservation/enterDetails/payment"

export default async function Payment({
  otherPaymentOptions,
  mustBeGuaranteed,
  supportedCards,
}: PaymentProps) {
  const savedCreditCards = await getSavedPaymentCardsSafely({
    supportedCards,
  })

  return (
    <PaymentClient
      otherPaymentOptions={otherPaymentOptions}
      savedCreditCards={savedCreditCards}
      mustBeGuaranteed={mustBeGuaranteed}
    />
  )
}
