/** @format */ /** * External dependencies */ import { __ } from '@wordpress/i18n'; import { Button } from '@wordpress/components'; import { Fragment } from '@wordpress/element'; function HistoricalDataActions( { customersProgress, customersTotal, hasImportedData, inProgress, onDeletePreviousData, onStartImport, onStopImport, ordersProgress, ordersTotal, } ) { const getActions = () => { // An import is currently in progress if ( inProgress ) { return (
{ __( 'Imported data will not be lost if the import is stopped.', 'woocommerce-admin' ) }
{ __( 'Navigating away from this page will not affect the import.', 'woocommerce-admin' ) }
); } // Has no imported data if ( ! hasImportedData ) { // @todo When the import status endpoint is hooked up, // the 'Delete Previously Imported Data' button should be // removed from this section. return ( ); } // Has imported all possible data if ( customersProgress === customersTotal && ordersProgress === ordersTotal ) { return ( ); } // It's not in progress and has some imported data return ( ); }; return (
{ getActions() }
); } export default HistoricalDataActions;