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-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 } />;
|
|
|
|
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;
|