<commit_before>//Tip class
export default class SiimpleTip extends React.Component
{
  //Available icons
  private available_icons = [ 'exclamation', 'question', 'hearth' ];

  //Constructor
  constructor(props)
  {
    //Call super
    super(props);

    //Set the state
    this.state = { color: null, icon: null };

    //Update props
    this.componentWillReceiveProps(props);
  }

  //Parse new props
  componentWillReceiveProps(props)
  {
    //Parse the color property
    if(typeof props.color !== 'undefined' && props.color !== this.state.color)
    {
      //Change the color state value
      this.state.color = props.color;
    }

    //Parse the icon property
    if(typeof props.icon !== 'undefined' && props.icon !== this.state.icon)
    {
      //Save the icon state value
      this.state.icon = props.icon;
    }
  }

  //Render the tip element
  render()
  {
    //Create element alias
    var el = React.createElement;

    //Initialize the tip class list
    var class_list = [ 'siimple-tip' ];

    //Add the tip color
    if(typeof this.state.color === 'string')
    {
      //Append the color class
      class_list.push('siimple-tip--' + this.state.color);
    }

    //Add the tip icon
    if(typeof this.state.icon === 'string')
    {
      //Check if this icon exists
      if(this.available_icons.indexOf(this.state.icon.toLowerCase().trim()) !== -1)
      {
        //Append the icon class
        class_list.push('siimple-tip--' + this.state.icon);
      }
    }

    //Return the element
    return el('div', { className: class_list.join(' ') }, this.props.children);
  }
}<commit_msg>src/tip.js: fixed bug<commit_after>//Tip class
export default class SiimpleTip extends React.Component
{
  //Constructor
  constructor(props)
  {
    //Call super
    super(props);

    //Set the state
    this.state = { color: null, icon: null };

    //Available icons
    this._icons = [ 'exclamation', 'question', 'hearth' ];

    //Update props
    this.componentWillReceiveProps(props);
  }

  //Parse new props
  componentWillReceiveProps(props)
  {
    //Parse the color property
    if(typeof props.color !== 'undefined' && props.color !== this.state.color)
    {
      //Change the color state value
      this.state.color = props.color;
    }

    //Parse the icon property
    if(typeof props.icon !== 'undefined' && props.icon !== this.state.icon)
    {
      //Save the icon state value
      this.state.icon = props.icon;
    }
  }

  //Render the tip element
  render()
  {
    //Create element alias
    var el = React.createElement;

    //Initialize the tip class list
    var class_list = [ 'siimple-tip' ];

    //Add the tip color
    if(typeof this.state.color === 'string')
    {
      //Append the color class
      class_list.push('siimple-tip--' + this.state.color);
    }

    //Add the tip icon
    if(typeof this.state.icon === 'string')
    {
      //Check if this icon exists
      if(this._icons.indexOf(this.state.icon.toLowerCase().trim()) !== -1)
      {
        //Append the icon class
        class_list.push('siimple-tip--' + this.state.icon);
      }
    }

    //Return the element
    return el('div', { className: class_list.join(' ') }, this.props.children);
  }
}
{'fraction_non_alphanumeric': 0.14015503875968993, 'fraction_numerical': 0.00062015503875969, 'mean_word_length': 2.322348094747683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '442112', 'n_tokens_mistral': 1007, 'n_tokens_neox': 975, 'n_words': 255}