woocommerce/plugins/woocommerce-admin/client/analytics/report/coupons/index.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-09-17 02:26:34 +00:00
/** @format */
/**
* External dependencies
*/
import { Component, Fragment } from '@wordpress/element';
import PropTypes from 'prop-types';
/**
* WooCommerce dependencies
*/
import { ReportFilters } from '@woocommerce/components';
2018-09-17 02:26:34 +00:00
/**
* Internal dependencies
*/
import { charts, filters } from './config';
import CouponsReportTable from './table';
import getSelectedChart from 'lib/get-selected-chart';
import ReportChart from 'analytics/components/report-chart';
import ReportSummary from 'analytics/components/report-summary';
2018-09-17 02:26:34 +00:00
export default class CouponsReport extends Component {
2018-09-17 02:26:34 +00:00
render() {
const { query, path } = this.props;
return (
<Fragment>
<ReportFilters query={ query } path={ path } filters={ filters } />
<ReportSummary
charts={ charts }
endpoint="orders"
query={ query }
selectedChart={ getSelectedChart( query.chart, charts ) }
/>
<ReportChart
charts={ charts }
endpoint="orders"
path={ path }
query={ query }
selectedChart={ getSelectedChart( query.chart, charts ) }
/>
<CouponsReportTable query={ query } />
2018-09-17 02:26:34 +00:00
</Fragment>
);
}
}
CouponsReport.propTypes = {
query: PropTypes.object.isRequired,
};