{{!-- Items Tab --}}
<div class="tab weapons {{#if (eq activeSheetTab "weapons")}}active{{/if}}" data-group="sheet" data-tab="weapons">

  <div class="skills-controls">
    <h3>{{localize "UA2E.Weapons.Header"}}</h3>
    <button type="button" data-action="createWeapon" data-category="weapon" class="create-btn">
      <i class="fas fa-plus"></i> {{localize "UA2E.Weapons.NewWeapon"}}
    </button>
    <button type="button" data-action="createWeapon" data-category="general" class="create-btn">
      <i class="fas fa-plus"></i> {{localize "UA2E.Weapons.New"}}
    </button>
  </div>

  <h4>{{localize "UA2E.Weapons.WeaponsList"}}</h4>
  {{#if weaponItems.length}}
  <table class="skill-table weapon-table">
    <thead>
      <tr>
        <th>{{localize "UA2E.Common.Name"}}</th>
        <th>{{localize "UA2E.Weapons.Details"}}</th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      {{#each weaponItems as |weapon|}}
      <tr data-item-id="{{weapon.id}}" class="skill-row weapon-row">
        <td class="skill-name-col">
          <span class="skill-name">{{weapon.name}}</span>
          <span class="tag free-tag">{{localize (concat "UA2E.Item.Badge" (capitalize weapon.category))}}</span>
        </td>
        <td class="skill-value-col">
          {{#if (eq weapon.weaponMode "firearm")}}
          <span class="skill-value">{{localize "UA2E.Weapon.MaxDamage"}}: {{weapon.maxDamage}}</span>
          {{else}}
          <span class="skill-value">{{localize "UA2E.Weapon.WeaponBonus"}}: +{{weapon.weaponBonus}}</span>
          {{/if}}
          {{#if weapon.description}}
          <br />
          <span class="skill-value">{{weapon.description}}</span>
          {{else if weapon.notes}}
          <br />
          <span class="skill-value">{{weapon.notes}}</span>
          {{/if}}
        </td>
        <td class="skill-controls-col">
          <button type="button" data-action="rollWeaponDamage" data-tooltip="{{localize "UA2E.Weapons.RollDamage" name=weapon.name}}"><i class="fas fa-dice-d10"></i></button>
          <button type="button" data-action="editWeapon" data-tooltip="{{localize "UA2E.Common.Edit"}}"><i class="fas fa-edit"></i></button>
          <button type="button" data-action="deleteWeapon" data-tooltip="{{localize "UA2E.Common.Delete"}}"><i class="fas fa-trash"></i></button>
        </td>
      </tr>
      {{/each}}
    </tbody>
  </table>
  {{else}}
  <p class="hint">{{localize "UA2E.Weapons.EmptyWeapons"}}</p>
  {{/if}}

  <h4>{{localize "UA2E.Weapons.OtherItemsList"}}</h4>
  {{#if nonWeaponItems.length}}
  <table class="skill-table weapon-table">
    <thead>
      <tr>
        <th>{{localize "UA2E.Common.Name"}}</th>
        <th>{{localize "UA2E.Weapons.Details"}}</th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      {{#each nonWeaponItems as |item|}}
      <tr data-item-id="{{item.id}}" class="skill-row weapon-row">
        <td class="skill-name-col">
          <span class="skill-name">{{item.name}}</span>
          <span class="tag free-tag">{{localize (concat "UA2E.Item.Badge" (capitalize item.category))}}</span>
        </td>
        <td class="skill-value-col">
          {{#if item.description}}
          <span class="skill-value">{{item.description}}</span>
          {{else if item.notes}}
          <span class="skill-value">{{item.notes}}</span>
          {{else}}
          <span class="hint">{{localize "UA2E.Common.Description"}}</span>
          {{/if}}
        </td>
        <td class="skill-controls-col">
          <button type="button" data-action="editWeapon" data-tooltip="{{localize "UA2E.Common.Edit"}}"><i class="fas fa-edit"></i></button>
          <button type="button" data-action="deleteWeapon" data-tooltip="{{localize "UA2E.Common.Delete"}}"><i class="fas fa-trash"></i></button>
        </td>
      </tr>
      {{/each}}
    </tbody>
  </table>
  {{else}}
  <p class="hint">{{localize "UA2E.Weapons.EmptyItems"}}</p>
  {{/if}}

</div>