{{!-- Weapon Item Sheet --}}
<div class="ua2e-item-sheet weapon-sheet">
  <header class="item-sheet-header flexrow">
    <img class="item-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
    <div class="header-fields">
      <input class="item-name" type="text" name="name" value="{{item.name}}" placeholder="{{localize "UA2E.Weapon.NamePlaceholder"}}" />
    </div>
  </header>

  <section class="sheet-body">
    <div class="form-group">
      <label>{{localize "UA2E.Item.Category"}}</label>
      <select name="system.category">
        {{#each categoryChoices as |label key|}}
          <option value="{{key}}" {{#if (eq ../category key)}}selected{{/if}}>{{label}}</option>
        {{/each}}
      </select>
    </div>

    {{#if (eq category "weapon")}}
    <div class="form-group">
      <label>{{localize "UA2E.Weapon.Mode"}}</label>
      <select name="system.weaponMode">
        {{#each weaponModeChoices as |label key|}}
          <option value="{{key}}" {{#if (eq ../weaponMode key)}}selected{{/if}}>{{label}}</option>
        {{/each}}
      </select>
    </div>
    {{/if}}

    <div class="form-group">
      <label>{{localize "UA2E.Common.Description"}}</label>
      <textarea name="system.description" rows="3" placeholder="{{localize "UA2E.Weapon.DescriptionPlaceholder"}}">{{system.description}}</textarea>
    </div>

    <div class="form-group">
      <label>{{localize "UA2E.Common.Notes"}}</label>
      <textarea name="system.notes" rows="3" placeholder="{{localize "UA2E.Weapon.NotesPlaceholder"}}">{{system.notes}}</textarea>
    </div>

    {{#if (eq category "weapon")}}
    {{#if (eq weaponMode "firearm")}}
    <div class="form-group">
      <label>{{localize "UA2E.Weapon.MaxDamage"}}</label>
      <input type="number" name="system.maxDamage" value="{{system.maxDamage}}" min="1" max="100" placeholder="50" />
    </div>

    <div class="form-group">
      <label>{{localize "UA2E.Weapon.Damage"}}</label>
      <span></span>
    </div>
    <p class="hint">{{localize "UA2E.Weapon.FirearmDamageHint"}}</p>

    <div class="form-group checkbox-group">
      <label>{{localize "UA2E.Weapon.ArmorPiercing"}}</label>
      <input type="checkbox" name="system.armorPiercing" {{#if system.armorPiercing}}checked{{/if}} />
    </div>
    {{else}}
    <div class="form-group">
      <label>{{localize "UA2E.Weapon.WeaponBonus"}}</label>
      <input type="number" name="system.weaponBonus" value="{{system.weaponBonus}}" min="0" max="30" placeholder="3" />
    </div>
    <p class="hint">{{localize "UA2E.Weapon.MeleeDamageHint"}}</p>
    {{/if}}
    {{/if}}
  </section>
</div>
