<commit_before>import * as React from 'react';
import { ucFirst } from "../utils";

class Status extends React.Component<any, any> {

  public render() {

    if (!this.props.player) {
      return (
        <p>Loading...</p>
      )
    }

    return (
      <div>
        <div className="status-widget player">
          <div className="container">
            <div className="row">
              <p className="heading">You are the { this.props.player.getGenderLabel() } { this.props.player.name }</p>
            </div>

            <div className="stats row">
              <div className="col-3 hardiness">HD: { this.props.player.hardiness }</div>
              <div className="col-3 agility">AG: { this.props.player.agility }</div>
              <div className="col-3 charisma">CH: { this.props.player.charisma }</div>
            </div>

            <div className="spell-abilities row">
              <div className="axe col-sm-3">Blast:<br/> { this.props.player.spell_abilities_original.blast }%</div>
              <div className="bow col-sm-3">Heal:<br/> { this.props.player.spell_abilities_original.heal }%</div>
              <div className="club col-sm-3">Power:<br/> { this.props.player.spell_abilities_original.power }%</div>
              <div className="spear col-sm-3">Speed:<br/> { this.props.player.spell_abilities_original.speed }%</div>
            </div>

            <div className="weapon-abilities row">
              <div className="axe col-sm-2">Axe: { this.props.player.wpn_axe }%</div>
              <div className="bow col-sm-2">Bow: { this.props.player.wpn_bow }%</div>
              <div className="club col-sm-2">Club: { this.props.player.wpn_club }%</div>
              <div className="spear col-sm-2">Spear: { this.props.player.wpn_spear }%</div>
              <div className="sword col-sm-2">Sword: { this.props.player.wpn_sword }%</div>
            </div>

            <div className="ae row">
              <div className="col-sm-12">Armor expertise: { this.props.player.armor_expertise }%</div>
            </div>

            <div className="gold row">
              <div className="col-sm-6">Gold in hand: { this.props.player.gold }</div>
              <div className="col-sm-6">Gold in bank: { this.props.player.gold_in_bank }</div>
            </div>
          </div>

        </div>

      <div className="status-widget inventory">
        <p className="heading">Inventory</p>

        <div className="container">
          {this.props.player.inventory.length === 0 && <div className="row">No items</div>}

          {this.props.player.inventory.map(artifact => {
            const icon_url = '/static/images/ravenmore/128/' + artifact.getIcon() + '.png';

            if (artifact.isWeapon()) {
              const odds = (artifact.weapon_odds > 0 ? "+" : "") + artifact.weapon_odds;
              return (
                <div key={artifact.uuid} className="row"><commit_msg>Main Hall: sort player inventory by type<commit_after>import * as React from 'react';
import { ucFirst } from "../utils";

class Status extends React.Component<any, any> {

  public render() {

    if (!this.props.player) {
      return (
        <p>Loading...</p>
      )
    }

    // sort artifacts by type - weapons first, then armor
    let artifacts = this.props.player.inventory.sort((a, b) => {
      let typeA = a.type === 2 || a.type === 3 ? 2 : a.type;
      let typeB = b.type === 2 || b.type === 3 ? 2 : b.type;
      return typeA - typeB;
    });

    return (
      <div>
        <div className="status-widget player">
          <div className="container">
            <div className="row">
              <p className="heading">You are the { this.props.player.getGenderLabel() } { this.props.player.name }</p>
            </div>

            <div className="stats row">
              <div className="col-3 hardiness">HD: { this.props.player.hardiness }</div>
              <div className="col-3 agility">AG: { this.props.player.agility }</div>
              <div className="col-3 charisma">CH: { this.props.player.charisma }</div>
            </div>

            <div className="spell-abilities row">
              <div className="axe col-sm-3">Blast:<br/> { this.props.player.spell_abilities_original.blast }%</div>
              <div className="bow col-sm-3">Heal:<br/> { this.props.player.spell_abilities_original.heal }%</div>
              <div className="club col-sm-3">Power:<br/> { this.props.player.spell_abilities_original.power }%</div>
              <div className="spear col-sm-3">Speed:<br/> { this.props.player.spell_abilities_original.speed }%</div>
            </div>

            <div className="weapon-abilities row">
              <div className="axe col-sm-2">Axe: { this.props.player.wpn_axe }%</div>
              <div className="bow col-sm-2">Bow: { this.props.player.wpn_bow }%</div>
              <div className="club col-sm-2">Club: { this.props.player.wpn_club }%</div>
              <div className="spear col-sm-2">Spear: { this.props.player.wpn_spear }%</div>
              <div className="sword col-sm-2">Sword: { this.props.player.wpn_sword }%</div>
            </div>

            <div className="ae row">
              <div className="col-sm-12">Armor expertise: { this.props.player.armor_expertise }%</div>
            </div>

            <div className="gold row">
              <div className="col-sm-6">Gold in hand: { this.props.player.gold }</div>
              <div className="col-sm-6">Gold in bank: { this.props.player.gold_in_bank }</div>
            </div>
          </div>

        </div>

      <div className="status-widget inventory">
        <p className="heading">Inventory</p>

        <div className="container">
          {artifacts.length === 0 && <div className="row">No items</div>}

          {artifacts.map(artifact => {
            const icon_url = '/static/images/ravenmore/128/' + artifact.getIcon() + '.png';

            if (artifact.isWeapon()) {
              const odds = (artifact.weapon_odds > 0 ? "+" : "") + artifact.weapon_odds;
              return (
                <div key={artifact.uuid} className="row">
{'fraction_non_alphanumeric': 0.16702075502533092, 'fraction_numerical': 0.00784441902271613, 'mean_word_length': 2.1578947368421053, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 134, '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': '5092917', 'n_tokens_mistral': 1947, 'n_tokens_neox': 1881, 'n_words': 366}