<commit_before>import React from 'react/addons';

class EnrollmentStatus extends React.Component {

  getStatusClass(status) {
    var labelClasses = {
      open: 'label label-success text-capitalize',
      closed: 'label label-danger text-capitalize',
      waitlist: 'label label-warning text-capitalize'
    };

    return labelClasses[status];
  }

  getCountClass(enrollment) {
    var fillPerecent = enrollment.enrollment_total / enrollment.enrollment_capacity;

    if (fillPerecent >= 0.8 && fillPerecent < 0.9) {
      return 'label label-default text-warning';
    }

    if (fillPerecent >= 0.9) {
      return 'label label-default text-danger';
    }

    return 'label label-default';
  }

  render() {
    return (
      <div className="label-group h4">
        <span className={this.getStatusClass(this.props.enrollment.status)}>
          {status}
        </span>
        <span className={this.getCountClass(this.props.enrollment)}>
          {this.props.enrollment.enrollment_total}/{this.props.enrollment.enrollment_capacity}
        </span>
      </div>
    );
  }
}<commit_msg>Fix status display in EnrollmentStatus<commit_after>import React from 'react/addons';

class EnrollmentStatus extends React.Component {

  getStatusClass(status) {
    var labelClasses = {
      open: 'label label-success text-capitalize',
      closed: 'label label-danger text-capitalize',
      waitlist: 'label label-warning text-capitalize'
    };

    return labelClasses[status];
  }

  getCountClass(enrollment) {
    var fillPerecent = enrollment.enrollment_total / enrollment.enrollment_capacity;

    if (fillPerecent >= 0.8 && fillPerecent < 0.9) {
      return 'label label-default text-warning';
    }

    if (fillPerecent >= 0.9) {
      return 'label label-default text-danger';
    }

    return 'label label-default';
  }

  render() {
    return (
      <div className="label-group h4">
        <span className={this.getStatusClass(this.props.enrollment.status)}>
          {this.props.enrollment.status}
        </span>
        <span className={this.getCountClass(this.props.enrollment)}>
          {this.props.enrollment.enrollment_total}/{this.props.enrollment.enrollment_capacity}
        </span>
      </div>
    );
  }
}
{'fraction_non_alphanumeric': 0.12160356347438753, 'fraction_numerical': 0.0062360801781737195, 'mean_word_length': 2.954225352112676, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '2874024', 'n_tokens_mistral': 710, 'n_tokens_neox': 688, 'n_words': 130}