import {Trans} from '../../i18n/trans'; import {FormattedPrice} from '../../i18n/formatted-price'; import {useCheckoutProduct} from '../requests/use-checkout-product'; import {m} from 'framer-motion'; import {Skeleton} from '../../ui/skeleton/skeleton'; import {Product} from '../product'; import {Price} from '../price'; import {FormattedCurrency} from '../../i18n/formatted-currency'; import {ProductFeatureList} from '../pricing-table/product-feature-list'; import {opacityAnimation} from '../../ui/animation/opacity-animation'; interface CheckoutProductSummaryProps { showBillingLine?: boolean; } export function CheckoutProductSummary({ showBillingLine = true, }: CheckoutProductSummaryProps) { const {status, product, price} = useCheckoutProduct(); if (status === 'error' || (status !== 'pending' && (!product || !price))) { return null; } return (

{status === 'pending' ? ( ) : ( )}
); } interface ProductSummaryProps { product: Product; price: Price; showBillingLine: boolean; } function ProductSummary({ product, price, showBillingLine, }: ProductSummaryProps) { return (
{product.name}
{product.description && (
{product.description}
)} {showBillingLine && (
)}
); } function LoadingSkeleton() { return ( ); }