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


const MessageBox = (props) => {
  const onClick = () => {
    props.onClose(props.index);
  };

  return (
    <div className={`message-box ${props.message.level || ''}`}>
      {1 < props.message.count ?
        <span className="badge">{props.message.count}</span> : null
      }
      <p>{props.message.content}</p>
      <button
        className="close-button"
        onClick={onClick}
      >
        <span>&times;</span>
      </button>
    </div>
  );
};

MessageBox.propTypes = {
  index: PropTypes.number.isRequired,
  message: PropTypes.shape({
    content: PropTypes.string.isRequired,
    level: PropTypes.string,
    count: PropTypes.number,
  }).isRequired,
  onClose: PropTypes.func.isRequired,
};

export default MessageBox;<commit_msg>Allow react components in MessageBox/notifications<commit_after>import React, { PropTypes } from 'react';


const MessageBox = (props) => {
  const onClick = () => {
    props.onClose(props.index);
  };

  return (
    <div className={`message-box ${props.message.level || ''}`}>
      {1 < props.message.count ?
        <span className="badge">{props.message.count}</span> : null
      }
      <p>{props.message.content}</p>
      <button
        className="close-button"
        onClick={onClick}
      >
        <span>&times;</span>
      </button>
    </div>
  );
};

MessageBox.propTypes = {
  index: PropTypes.number.isRequired,
  message: PropTypes.shape({
    content: PropTypes.oneOfType([
      PropTypes.string,
      PropTypes.object,
    ]).isRequired,
    level: PropTypes.string,
    count: PropTypes.number,
  }).isRequired,
  onClose: PropTypes.func.isRequired,
};

export default MessageBox;
{'fraction_non_alphanumeric': 0.15862870424171993, 'fraction_numerical': 0.0011621150493898896, 'mean_word_length': 2.9047619047619047, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, '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': '5515510', 'n_tokens_mistral': 531, 'n_tokens_neox': 544, 'n_words': 94}