<section data-tab="inventory" data-group="{{tab.group}}" class="tab {{tab.cssClass}}">
  <p class="settlement-hint">{{localize "OATHHAMMER.Settlement.InventoryHint"}}</p>

  {{#if weapons.length}}
  <fieldset>
    <legend>{{localize "OATHHAMMER.Label.Weapons"}}</legend>
    <ul class="item-list item-list--weapons">
      <li class="item-list-header">
        <span></span>
        <span class="col-name">{{localize "OATHHAMMER.Label.Name"}}</span>
        <span>{{localize "OATHHAMMER.Label.Type"}}</span>
        <span></span>
      </li>
      {{#each weapons as |weapon|}}
      <li class="item-entry" data-item-id="{{weapon.id}}" data-item-uuid="{{weapon.uuid}}">
        <img src="{{weapon.img}}" class="item-img" />
        <span class="item-name">{{weapon.name}}</span>
        <span class="item-type">{{weapon.system.weaponType}}</span>
        <div class="item-actions">
          <a data-action="edit" data-item-id="{{weapon.id}}" data-item-uuid="{{weapon.uuid}}"><i class="fa-solid fa-edit"></i></a>
          {{#unless ../isPlayMode}}<a data-action="delete" data-item-id="{{weapon.id}}" data-item-uuid="{{weapon.uuid}}"><i class="fa-solid fa-trash"></i></a>{{/unless}}
        </div>
      </li>
      {{/each}}
    </ul>
  </fieldset>
  {{/if}}

  {{#if armors.length}}
  <fieldset>
    <legend>{{localize "OATHHAMMER.Label.Armors"}}</legend>
    <ul class="item-list item-list--armors">
      <li class="item-list-header">
        <span></span>
        <span class="col-name">{{localize "OATHHAMMER.Label.Name"}}</span>
        <span>{{localize "OATHHAMMER.Label.Type"}}</span>
        <span></span>
      </li>
      {{#each armors as |armor|}}
      <li class="item-entry" data-item-id="{{armor.id}}" data-item-uuid="{{armor.uuid}}">
        <img src="{{armor.img}}" class="item-img" />
        <span class="item-name">{{armor.name}}</span>
        <span class="item-type">{{localize armor.system.armorType}}</span>
        <div class="item-actions">
          <a data-action="edit" data-item-id="{{armor.id}}" data-item-uuid="{{armor.uuid}}"><i class="fa-solid fa-edit"></i></a>
          {{#unless ../isPlayMode}}<a data-action="delete" data-item-id="{{armor.id}}" data-item-uuid="{{armor.uuid}}"><i class="fa-solid fa-trash"></i></a>{{/unless}}
        </div>
      </li>
      {{/each}}
    </ul>
  </fieldset>
  {{/if}}

  {{#if equipments.length}}
  <fieldset>
    <legend>{{localize "OATHHAMMER.Label.Equipment"}}</legend>
    <ul class="item-list item-list--equipment">
      <li class="item-list-header">
        <span></span>
        <span class="col-name">{{localize "OATHHAMMER.Label.Name"}}</span>
        <span>{{localize "OATHHAMMER.Label.Type"}}</span>
        <span>{{localize "OATHHAMMER.Label.Quantity"}}</span>
        <span></span>
      </li>
      {{#each equipments as |equip|}}
      <li class="item-entry" data-item-id="{{equip.id}}" data-item-uuid="{{equip.uuid}}">
        <img src="{{equip.img}}" class="item-img" />
        <span class="item-name">{{equip.name}}</span>
        <span class="item-type">{{localize equip.system.itemType}}</span>
        <span class="item-qty-stepper">
          {{#unless ../isPlayMode}}
          <a data-action="adjustQty" data-item-id="{{equip.id}}" data-delta="-1" class="qty-btn">−</a>
          {{/unless}}
          <span class="qty-value">{{equip.system.quantity}}</span>
          {{#unless ../isPlayMode}}
          <a data-action="adjustQty" data-item-id="{{equip.id}}" data-delta="1" class="qty-btn">+</a>
          {{/unless}}
        </span>
        <div class="item-actions">
          <a data-action="edit" data-item-id="{{equip.id}}" data-item-uuid="{{equip.uuid}}"><i class="fa-solid fa-edit"></i></a>
          {{#unless ../isPlayMode}}<a data-action="delete" data-item-id="{{equip.id}}" data-item-uuid="{{equip.uuid}}"><i class="fa-solid fa-trash"></i></a>{{/unless}}
        </div>
      </li>
      {{/each}}
    </ul>
  </fieldset>
  {{/if}}

  {{#unless weapons.length}}
  {{#unless armors.length}}
  {{#unless equipments.length}}
  <p class="no-items">{{localize "OATHHAMMER.Settlement.NoInventory"}}</p>
  {{/unless}}
  {{/unless}}
  {{/unless}}
</section>
