<commit_before>"use strict";

var oo = require('../util/oo');
var Component = require('./Component');
var $$ = Component.$$;

var ICONS_FOR_TYPE = {
  "error": "fa-exclamation-circle",
  "info": "fa-info",
  "progress": "fa-exchange",
  "success": "fa-check-circle",
};

/**
  @class StatusBar
  @component
*/

/**
  @constructor StatusBar.$$
  @param {model/Document} doc The document instance
*/

function StatusBar() {
  Component.apply(this, arguments);

  var ctrl = this.context.controller;
  var logger = ctrl.getLogger();
  logger.connect(this, {
    'messages:updated': this.handleStatusUpdate
  });
}

StatusBar.Prototype = function() {

  this.render = function() {
    var meta = this.props.doc.getDocumentMeta();
    var title = meta ? meta.title : this.i18n.t('untitled');
    var message = this.state.message;

    var el = $$('div').addClass("status-bar-component fill-light");
    el.append($$("div").addClass("document-status").append(title));

    if (message) {
      el.addClass(message.type);<commit_msg>Example for using custom tags @prop and @state.<commit_after>"use strict";

var oo = require('../util/oo');
var Component = require('./Component');
var $$ = Component.$$;

var ICONS_FOR_TYPE = {
  "error": "fa-exclamation-circle",
  "info": "fa-info",
  "progress": "fa-exchange",
  "success": "fa-check-circle",
};

/**
  @class
  @component

  @prop {model/Document} doc The document instance

  @state {String} message The message displayed in the status bar.
*/

function StatusBar() {
  Component.apply(this, arguments);

  var ctrl = this.context.controller;
  var logger = ctrl.getLogger();
  logger.connect(this, {
    'messages:updated': this.handleStatusUpdate
  });
}

StatusBar.Prototype = function() {

  this.render = function() {
    var meta = this.props.doc.getDocumentMeta();
    var title = meta ? meta.title : this.i18n.t('untitled');
    var message = this.state.message;

    var el = $$('div').addClass("status-bar-component fill-light");
    el.append($$("div").addClass("document-status").append(title));

    if (message) {
      el.addClass(message.type);
{'fraction_non_alphanumeric': 0.1793168880455408, 'fraction_numerical': 0.0018975332068311196, 'mean_word_length': 3.8482758620689657, 'pattern_counts': {'":': 8, '<': 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': '2045655', 'n_tokens_mistral': 681, 'n_tokens_neox': 665, 'n_words': 147}