import { FC } from 'react' import s from './PaymentWidget.module.css' import { ChevronRight, CreditCard, Trash } from '@components/icons' import { useUI } from '@components/ui/context' interface ComponentProps { onClick?: () => any } const PaymentWidget: FC = ({ onClick }) => { const { paymentMethodDetails } = useUI() console.log(paymentMethodDetails) /* Shipping Address Only available with checkout set to true - This means that the provider does offer checkout functionality. */ return (
{paymentMethodDetails?.paymentMethod ? {paymentMethodDetails.address.cardholderName}
{paymentMethodDetails.paymentMethod.card.brand.toUpperCase()} **** **** **** {paymentMethodDetails.paymentMethod.card.last4}
: Add Payment Method }
{paymentMethodDetails?.paymentMethod ? : }
) } export default PaymentWidget