<commit_before>import React, { Component, PropTypes } from 'react';

class StyleButton extends Component {
  constructor() {
    super();

    this.onToggle = (e) => {
      e.preventDefault();
      this.props.onToggle(this.props.style);
    };
  }

  render() {
    let className = 'DraftJSEditor-styleButton';
    if (this.props.active) {
      className += ' DraftJSEditor-activeButton';
    }

    return (
      <span className={className} onMouseDown={this.onToggle}>
        {this.props.icon ? this.props.icon : this.props.label}
      </span>
    );
  }
}

StyleButton.propTypes = {<commit_msg>Add title attribute with label to control buttons<commit_after>import React, { Component, PropTypes } from 'react';

class StyleButton extends Component {
  constructor() {
    super();

    this.onToggle = (e) => {
      e.preventDefault();
      this.props.onToggle(this.props.style);
    };
  }

  render() {
    let className = 'DraftJSEditor-styleButton';
    if (this.props.active) {
      className += ' DraftJSEditor-activeButton';
    }

    return (
      <span
        className={className}
        title={this.props.label}
        onMouseDown={this.onToggle}
      >
        {this.props.icon ? this.props.icon : this.props.label}
      </span>
    );
  }
}

StyleButton.propTypes = {
{'fraction_non_alphanumeric': 0.13944530046224962, 'fraction_numerical': 0.0, 'mean_word_length': 2.648876404494382, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '333818', 'n_tokens_mistral': 411, 'n_tokens_neox': 406, 'n_words': 74}