/** * External dependencies */ import { __, sprintf } from '@wordpress/i18n'; import { InnerBlocks } from '@wordpress/block-editor'; import { SHOP_URL } from '@woocommerce/block-settings'; import PropTypes from 'prop-types'; /** * Internal dependencies */ import iconDataUri from './icon-data-uri.js'; import './style.scss'; /** * Component to handle edit mode for the Cart block when cart is empty. */ const EmptyCartEdit = ( { hidden } ) => { // We need to always render `` in the editor. // Otherwise, if the user saves the page without having // triggered the 'Empty Cart' view, inner blocks would not // be saved and they wouldn't be visible in the frontend. // We wrap them in a hidden `
` if the user is in // the editor 'Full Cart' view so they are not visible. return ( ); }; EmptyCartEdit.propTypes = { hidden: PropTypes.bool, }; export default EmptyCartEdit;