2016-02-22 14:36:07 -06:00
|
|
|
import React from 'react';
|
|
|
|
|
import _ from 'lodash';
|
|
|
|
|
export default function () {
|
2016-02-29 18:20:00 -06:00
|
|
|
return React.createElement('div', { 'id': 'energy_view' }, this.state.loading_energy_data ? React.createElement('div', { 'className': 'alert alert-warning' }, '\n Retrieving energy data...\n ') : null, this.props.view === 'graph' ? React.createElement('div', {}, React.createElement('h4', {}, 'Select Data'), React.createElement('div', {
|
2016-02-22 14:36:07 -06:00
|
|
|
'className': 'btn-group',
|
|
|
|
|
'role': 'group'
|
|
|
|
|
}, React.createElement('button', {
|
2016-02-29 18:20:00 -06:00
|
|
|
'data-param': 'graph_attr',
|
2016-02-22 14:36:07 -06:00
|
|
|
'data-value': 'consumption',
|
|
|
|
|
'className': _.keys(_.pick({ active: this.state.graph_attr === 'consumption' }, _.identity)).join(' ') + ' ' + 'btn btn-primary',
|
2016-02-29 18:20:00 -06:00
|
|
|
'onClick': this.setAttr,
|
2016-02-22 14:36:07 -06:00
|
|
|
'type': 'button'
|
|
|
|
|
}, 'Consumption'), React.createElement('button', {
|
2016-02-29 18:20:00 -06:00
|
|
|
'data-param': 'graph_attr',
|
2016-02-22 14:36:07 -06:00
|
|
|
'data-value': 'production',
|
|
|
|
|
'className': _.keys(_.pick({ active: this.state.graph_attr === 'production' }, _.identity)).join(' ') + ' ' + 'btn btn-primary',
|
|
|
|
|
'onClick': this.setGraphAttr,
|
|
|
|
|
'type': 'button'
|
2016-02-29 18:20:00 -06:00
|
|
|
}, 'Production'))) : null, '\n ', this.props.children, '\n');
|
2016-02-22 14:36:07 -06:00
|
|
|
};
|