<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
//
import AbstractComponent from '../AbstractComponent/AbstractComponent';
import Icon from '../Icon/Icon';

/**
 * Badge box
 *
 * @author <NAME>
 */
class Badge extends AbstractComponent {

  _onClose(event) {
    const { onClose } = this.props;
    if (!onClose) {
      return;
    }
    onClose(event);
  }

  render() {
    const { level, title, text, value, className, rendered, showLoading, ...others } = this.props;
    const _text = text || value;
    if (!rendered || !_text) {
      return null;
    }
    const classNames = classnames(
      'badge',
      `badge- ${ (level === 'error' ? 'danger' : level) }`,<commit_msg>Badge component - fix level<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
//
import AbstractComponent from '../AbstractComponent/AbstractComponent';
import Icon from '../Icon/Icon';

/**
 * Badge box
 *
 * @author <NAME>
 */
class Badge extends AbstractComponent {

  _onClose(event) {
    const { onClose } = this.props;
    if (!onClose) {
      return;
    }
    onClose(event);
  }

  render() {
    const { level, title, text, value, className, rendered, showLoading, ...others } = this.props;
    const _text = text || value;
    if (!rendered || !_text) {
      return null;
    }
    const classNames = classnames(
      'badge',
      `badge-${ (level === 'error' ? 'danger' : level) }`,
{'fraction_non_alphanumeric': 0.15003304692663583, 'fraction_numerical': 0.0, 'mean_word_length': 3.037333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2144568', 'n_tokens_mistral': 466, 'n_tokens_neox': 459, 'n_words': 133}