/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { withStoreCartApiHydration, withRestApiHydration, } from '@woocommerce/block-hocs'; import { useStoreCart } from '@woocommerce/base-context/hooks'; import { StoreNoticesProvider, ValidationContextProvider, } from '@woocommerce/base-context'; import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary'; import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings'; import { createInterpolateElement } from 'wordpress-element'; import { renderFrontend, getValidBlockAttributes, } from '@woocommerce/base-utils'; /** * Internal dependencies */ import Block from './block.js'; import blockAttributes from './attributes'; import EmptyCart from './empty-cart/index.js'; const reloadPage = () => void window.location.reload( true ); /** * Wrapper component for the checkout block. * * @param {Object} props Props for the block. */ const CheckoutFrontend = ( props ) => { const { cartItems, cartIsLoading } = useStoreCart(); return ( <> { ! cartIsLoading && cartItems.length === 0 ? ( ) : ( Try reloading the page. If the error persists, please get in touch with us so we can assist.', 'woo-gutenberg-products-block' ), { button: ( . If the error persists, please get in touch with us so we can assist.', 'woo-gutenberg-products-block' ), { button: (