woocommerce/plugins/woocommerce-admin/client/dashboard/index.js

33 lines
675 B
JavaScript

/**
* External dependencies
*/
import { Component, Suspense, lazy } from '@wordpress/element';
import { Spinner } from '@woocommerce/components';
/**
* Internal dependencies
*/
import './style.scss';
const CustomizableDashboard = lazy( () =>
import( /* webpackChunkName: "customizable-dashboard" */ './customizable' )
);
class Dashboard extends Component {
render() {
const { path, query } = this.props;
if ( window.wcAdminFeatures[ 'analytics-dashboard/customizable' ] ) {
return (
<Suspense fallback={ <Spinner /> }>
<CustomizableDashboard query={ query } path={ path } />
</Suspense>
);
}
return null;
}
}
export default Dashboard;