<commit_before>var React = require('react');
var Link = require('react-router').Link;
var styleMixin = require('mixins/style-mixin');
var DeviceState = React.createClass({
  mixins: [styleMixin(require('./style.scss'))],

  render: function render () {
    return (
        <div className="cc-device-state">
          <div className={'cc-device-state__image ' + this.getStateImageClass()}/>
          <div className="cc-device-state__text">{this.getConnectedText()}</div>
        </div>
    );
  },

  getStateImageClass: function getStateImageClass () {
    var name = 'cc-device-state__image-';
    if (this.props.state === 'connected') {
      return name + 'connected';
    } else {
      return name + 'disconnected';
    }
  },

  getConnectedText: function getConnectedText () {
    if (this.props.state === 'connected') {
      return 'Connected';
    } else {
      return 'Disconnected';
    }
  }
});

module.exports = DeviceState;<commit_msg>Add enum for state in device-state.<commit_after>var React = require('react');
var Link = require('react-router').Link;
var styleMixin = require('mixins/style-mixin');
var stateEnum = {
  CONNECTED: 'connected',
  DISCONNECTED: 'disconnected'
};

var DeviceState = React.createClass({
  mixins: [styleMixin(require('./style.scss'))],


  render: function render () {
    return (
        <div className="cc-device-state">
          <div className={'cc-device-state__image ' + this.getStateImageClass()}/>
          <div className="cc-device-state__text">{this.getConnectedText()}</div>
        </div>
    );
  },

  getStateImageClass: function getStateImageClass () {
    var name = 'cc-device-state__image-';
    if (this.props.state === stateEnum.CONNECTED) {
      return name + stateEnum.CONNECTED;
    } else {
      return name + stateEnum.DISCONNECTED;
    }
  },

  getConnectedText: function getConnectedText () {
    if (this.props.state === stateEnum.CONNECTED) {
      return 'Connected';
    } else {
      return 'Disconnected';
    }
  }
});

module.exports = DeviceState;
{'fraction_non_alphanumeric': 0.15523996082272282, 'fraction_numerical': 0.0, 'mean_word_length': 3.2474012474012475, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3437502', 'n_tokens_mistral': 634, 'n_tokens_neox': 633, 'n_words': 120}