/** @format */ /** * External dependencies */ import { __ } from '@wordpress/i18n'; import { Button } from '@wordpress/components'; import { Fragment } from '@wordpress/element'; function HistoricalDataActions( { importDate, onDeletePreviousData, onReimportData, onStartImport, onStopImport, status, } ) { const getActions = () => { const importDisabled = status !== 'ready'; // An import is currently in progress if ( [ 'initializing', 'customers', 'orders', 'finalizing' ].includes( status ) ) { 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' ) }
); } if ( [ 'ready', 'nothing' ].includes( status ) ) { if ( importDate ) { return ( ); } return ( ); } // Has imported all possible data return ( ); }; return (
{ getActions() }
); } export default HistoricalDataActions;