2017-02-11 20:39:38 -05:00
|
|
|
var React = require('react');
|
|
|
|
|
2017-02-15 20:56:41 -05:00
|
|
|
var StackedBarChart = require('../components/StackedBarChart');
|
2017-02-11 20:39:38 -05:00
|
|
|
|
|
|
|
module.exports = React.createClass({
|
|
|
|
displayName: "ReportsTab",
|
|
|
|
getInitialState: function() {
|
|
|
|
return { };
|
|
|
|
},
|
|
|
|
componentWillMount: function() {
|
|
|
|
this.props.onFetchReport("monthly_expenses");
|
|
|
|
},
|
|
|
|
render: function() {
|
2017-02-15 20:56:41 -05:00
|
|
|
report = [];
|
|
|
|
if (this.props.reports['monthly_expenses'])
|
|
|
|
report = (<StackedBarChart data={this.props.reports['monthly_expenses']} />);
|
2017-02-11 20:39:38 -05:00
|
|
|
return (
|
2017-02-15 20:56:41 -05:00
|
|
|
<div>
|
|
|
|
{report}
|
|
|
|
</div>
|
2017-02-11 20:39:38 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|