<commit_before>import Component from 'react-pure-render/component';
import R from 'ramda';
import React, { PropTypes } from 'react';
import { defineMessages, injectIntl, intlShape } from 'react-intl';
import { IconButton, Menu } from 'react-mdl/lib';
import { MenuItem } from 'react-mdl/lib/Menu';

class FermenterCommander extends Component {

  static propTypes = {
    fermenterRts: PropTypes.object.isRequired,
    fermenterStart: PropTypes.func.isRequired,
    fermenterStop: PropTypes.func.isRequired,
    intl: intlShape.isRequired,
  };

  render() {
    const { fermenterRts: rts, fermenterStart, fermenterStop } = this.props;

    if (R.empty(status)) {
      return (<div>No status yet...</div>);
    }

    return (
      <div style={{ position: 'relative' }}>
        <IconButton name="more_vert" id="fermenter_menu_upper_left" />
        <Menu target="fermenter_menu_upper_left" >
          <MenuItem onClick={fermenterStart}>Switch fermenter on</MenuItem>
          <MenuItem onClick={fermenterStop}>Switch fermenter off</MenuItem>
          <MenuItem disabled>Emergency off</MenuItem>
        </Menu>
        <p style={{ display: 'inline' }}>Current status: [{rts.status}]</p>
      </div>
    );
  }
}<commit_msg>Add last fermenter-command in status-display.<commit_after>import Component from 'react-pure-render/component';
import R from 'ramda';
import React, { PropTypes } from 'react';
import { defineMessages, injectIntl, intlShape } from 'react-intl';
import { IconButton, Menu } from 'react-mdl/lib';
import { MenuItem } from 'react-mdl/lib/Menu';

class FermenterCommander extends Component {

  static propTypes = {
    fermenterRts: PropTypes.object.isRequired,
    fermenterStart: PropTypes.func.isRequired,
    fermenterStop: PropTypes.func.isRequired,
    intl: intlShape.isRequired,
  };

  render() {
    const { fermenterRts: rts, fermenterStart, fermenterStop } = this.props;
    const maybeShowCurrentCmd = R.defaultTo(' -- ');

    if (R.isEmpty(rts.status)) {
      return (<div>No status yet...</div>);
    }

    return (
      <div style={{ position: 'relative' }}>
        <IconButton name="more_vert" id="fermenter_menu_upper_left" />
        <Menu target="fermenter_menu_upper_left" >
          <MenuItem onClick={fermenterStart}>Switch fermenter on</MenuItem>
          <MenuItem onClick={fermenterStop}>Switch fermenter off</MenuItem>
          <MenuItem disabled>Emergency off</MenuItem>
        </Menu>
        <p style={{ display: 'inline' }}>Current status: [{rts.status}]</p>
        <p style={{ display: 'inline' }}>| Last command: [{maybeShowCurrentCmd(rts.currentCmd)}]</p>
      </div>
    );
  }
}
{'fraction_non_alphanumeric': 0.13838612368024134, 'fraction_numerical': 0.0, 'mean_word_length': 3.6059027777777777, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7046107', 'n_tokens_mistral': 839, 'n_tokens_neox': 827, 'n_words': 184}