2018-05-15 15:06:15 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2018-06-14 20:15:11 +00:00
|
|
|
import { Component } from '@wordpress/element';
|
|
|
|
import PropTypes from 'prop-types';
|
2018-05-15 15:06:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-06-14 20:15:11 +00:00
|
|
|
import ExampleReport from './example';
|
|
|
|
import RevenueReport from './revenue';
|
2018-07-12 01:43:33 +00:00
|
|
|
import ProductsReport from './products';
|
2018-07-05 03:14:40 +00:00
|
|
|
import OrdersReport from './orders/';
|
2018-05-15 15:06:15 +00:00
|
|
|
|
2018-06-14 20:15:11 +00:00
|
|
|
class Report extends Component {
|
2018-05-15 15:06:15 +00:00
|
|
|
render() {
|
2018-06-14 20:15:11 +00:00
|
|
|
const { params } = this.props;
|
|
|
|
switch ( params.report ) {
|
|
|
|
case 'revenue':
|
|
|
|
return <RevenueReport { ...this.props } />;
|
2018-07-12 01:43:33 +00:00
|
|
|
case 'products':
|
|
|
|
return <ProductsReport { ...this.props } />;
|
2018-07-05 03:14:40 +00:00
|
|
|
case 'orders':
|
|
|
|
return <OrdersReport { ...this.props } />;
|
2018-06-14 20:15:11 +00:00
|
|
|
default:
|
|
|
|
return <ExampleReport />;
|
|
|
|
}
|
2018-05-15 15:06:15 +00:00
|
|
|
}
|
|
|
|
}
|
2018-06-14 20:15:11 +00:00
|
|
|
|
|
|
|
Report.propTypes = {
|
|
|
|
params: PropTypes.object.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Report;
|