/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { Button } from '@wordpress/components'; import { useState, useCallback } from '@wordpress/element'; import { recordEvent } from '@woocommerce/tracks'; /** * Internal dependencies */ import CartModal from '~/dashboard/components/cart-modal'; import TimerImage from './timer.svg'; import { WC_ASSET_URL } from '../../utils/admin-settings'; const PurchaseHeader = ( { task } ) => { const [ cartModalOpen, setCartModalOpen ] = useState( false ); const toggleCartModal = useCallback( () => { if ( ! cartModalOpen ) { recordEvent( 'tasklist_purchase_extensions' ); } setCartModalOpen( ! cartModalOpen ); }, [ cartModalOpen ] ); return (
{

{ task.title }

{ __( 'Good choice! You chose to add amazing new features to your store. Continue to checkout to complete your purchase.', 'woocommerce' ) }

Timer{ ' ' } { task.time }

{ cartModalOpen && ( toggleCartModal() } onClickPurchaseLater={ () => toggleCartModal() } /> ) }
); }; export default PurchaseHeader;