<commit_before>import React, { Component, PropTypes } from 'react';
import cx from 'classnames';
import styles from './Buttonbar.scss';

export default class Buttonbar extends Component {
  static propTypes = {
    onBan: PropTypes.func.isRequired,
    onControl: PropTypes.func.isRequired,
    onNext: PropTypes.func.isRequired,
    onTaste: PropTypes.func.isRequired,
    song: PropTypes.object.isRequired,
    playing: PropTypes.bool,
  }

  constructor(props) {
    super(props);
  }

  renderFavorite = (favorite, onClick) => {
    return (
      <a href="#" onClick={onClick} >
        <i className={cx('material-icons', { favorite })} > favorite </i>
      </a>
    );
  }

  renderPlay = (playing, onClick) => {
    const icon = playing ? 'pause' : 'play_arrow';
    return (
      <a href="#" onClick={onClick} >
        <i className="material-icons" > {icon} </i>
      </a>
    );
  }

  render() {
    const { song, playing } = this.props;

    return (
      <div className={styles.buttonBar}>
        <div className="tasteButtonGroup">
          {this.renderFavorite(song.favorite, this.props.onTaste)}
          <a href="#" onClick={this.props.onBan} >
            <i className="material-icons" > cancel </i>
          </a>
        </div>
        <div className="controlButtonGroup">
          {this.renderPlay(playing, this.props.onControl)}
          <a href="#" onClick={this.props.onNext} >
            <i className="material-icons" > skip_next </i>
          </a>
        </div>
      </div>
    );
  }
}<commit_msg>add title for buttons. Fixes #2<commit_after>import React, { Component, PropTypes } from 'react';
import cx from 'classnames';
import styles from './Buttonbar.scss';

export default class Buttonbar extends Component {
  static propTypes = {
    onBan: PropTypes.func.isRequired,
    onControl: PropTypes.func.isRequired,
    onNext: PropTypes.func.isRequired,
    onTaste: PropTypes.func.isRequired,
    song: PropTypes.object.isRequired,
    playing: PropTypes.bool,
  }

  constructor(props) {
    super(props);
  }

  renderFavorite = (favorite, onClick) => {
    const title = favorite ? '取消喜欢' : '喜欢';

    return (
      <a href="#" onClick={onClick} title={title} >
        <i className={cx('material-icons', { favorite })} > favorite </i>
      </a>
    );
  }

  renderPlay = (playing, onClick) => {
    const icon = playing ? 'pause' : 'play_arrow';
    const title = playing ? '暂停' : '播放';

    return (
      <a href="#" onClick={onClick} title={title}>
        <i className="material-icons" > {icon} </i>
      </a>
    );
  }

  render() {
    const { song, playing } = this.props;

    return (
      <div className={styles.buttonBar}>
        <div className="tasteButtonGroup">
          {this.renderFavorite(song.favorite, this.props.onTaste)}
          <a href="#" onClick={this.props.onBan} title="不再播放" >
            <i className="material-icons" > cancel </i>
          </a>
        </div>
        <div className="controlButtonGroup">
          {this.renderPlay(playing, this.props.onControl)}
          <a href="#" onClick={this.props.onNext} title="下一首" >
            <i className="material-icons" > skip_next </i>
          </a>
        </div>
      </div>
    );
  }
}
{'fraction_non_alphanumeric': 0.15546608857231342, 'fraction_numerical': 0.0003096934035305048, 'mean_word_length': 2.5494505494505493, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 51, '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': '2130014', 'n_tokens_mistral': 1027, 'n_tokens_neox': 1028, 'n_words': 221}