import { __, sprintf } from '@wordpress/i18n' import { Button } from '../../components/Button/Button' import { ReactComponent as GoNextIcon } from '../../../../public/images/icon-go-next.svg' import { GiftCardPolicyAccordion } from './GiftCardPolicyAccordion' import { GiftCardCheckoutBarProps } from './types' export const GiftCardCheckoutBar = ({ formattedAmount, recipientName, sendTiming, sendOnLabel, canPurchase, purchasing, onPurchase, policyHtml, showPurchaseButton = true, }: GiftCardCheckoutBarProps) => { const displayName = recipientName.trim() || __('the recipient', 'webba-booking-lite') const buttonLabel = formattedAmount ? sprintf( __('Buy %s gift card', 'webba-booking-lite'), formattedAmount ) : __('Buy gift card', 'webba-booking-lite') const footerText = sendTiming === 'later' && sendOnLabel ? sprintf( __('The gift card will be emailed to %s on %s.', 'webba-booking-lite'), displayName, sendOnLabel ) : sprintf( __( 'The gift card will be emailed to %s immediately after purchase.', 'webba-booking-lite' ), displayName ) return ( <>
{formattedAmount && (
{__('Total', 'webba-booking-lite')}{' '} {formattedAmount}
)} {showPurchaseButton && (
)}

{footerText}

) }