<div class="favorites list-layout">
  <ul class="inventory-list items-list">
  {{#if favItems}}
    <li class="items-header">
      <h3>{{localize 'DND5E.Inventory'}}</h3>
      <div class="items-header-labels">
        <div class="items-header-charge" title="{{localize 'DND5E.Charges'}}"><i class="fas fa-bolt"></i></div>
        <div class="items-header-usage">{{localize 'DND5E.Usage'}}</div>
      </div>
    </li>
    <ul class="item-list">
      {{#each favItems as |item id|}}
       {{> "modules/tidy5e-sheet/templates/favorites/item.hbs" item=item}}
      {{/each}}
    </ul>
  {{/if}}
  {{#if favFeats}}
    <li class="items-header">
      <h3>{{localize 'DND5E.Features'}}</h3>
      <div class="items-header-labels">
        <div class="items-header-uses">{{localize 'DND5E.Uses'}}</div>
        <div class="items-header-usage">{{localize 'DND5E.Usage'}}</div>
      </div>
    </li>
    <ul class="item-list">
      {{#each favFeats as |feat lvl|}}
      {{> "modules/tidy5e-sheet/templates/favorites/item.hbs" item=feat}}
      {{/each}}
    </ul>
  {{/if}}

  {{#if favSpellsPrepMode}}
    {{#each favSpellsPrepMode as |section lvl|}}
      {{#if section.spells}}
        {{#if lvl}}
          <li class="items-header spellbook-header">
            <div class="spell-level-slots">                                   
              <h3>
              {{#if section.isAlways}}{{localize 'DND5E.SpellPrepAlways'}}
              {{else if section.isAtWill}}{{localize 'DND5E.SpellPrepAtWill'}}
              {{else if section.isInnate}}{{localize 'DND5E.SpellPrepInnate'}}
              {{else if section.isPact}}{{localize 'DND5E.SpellProgPact'}}
              {{/if}}
              </h3>
              {{#if section.isPact}}
              <span class="spell-detail spell-slots">
                <input type="text" data-target="data.spells.spell{{lvl}}.value" value="{{section.value}}" placeholder="0"/>
                /
                <input class="spell-max" type="text" data-target="data.spells.spell{{lvl}}.override" value="{{section.max}}" placeholder="0"/>
              </span>
              {{else}}
              <!-- <span class="spell-slots">
                &ndash; / &ndash;
              </span> -->
              {{/if}}
            </div>
          </li>
        {{/if}}
        <ul class="item-list">
          {{#each section.spells as |spell id|}}
            {{> "modules/tidy5e-sheet/templates/favorites/item.hbs" item=spell}}
          {{/each}}
        </ul>
      {{/if}}
    {{/each}}
  {{/if}}
  {{#if favSpells}}
    {{#each favSpells as |section lvl|}}
      {{#if section.spells}}
        {{#if lvl}}
          <li class="items-header spellbook-header">
            <div class="spell-level-slots">                    
              <h3>
              {{#if section.isCantrip}}{{localize 'DND5E.SpellCantrip'}}
              {{else if section.isAlways}}{{localize 'DND5E.SpellPrepAlways'}}
              {{else if section.isAtWill}}{{localize 'DND5E.SpellPrepAtWill'}}
              {{else if section.isInnate}}{{localize 'DND5E.SpellPrepInnate'}}
              {{else if section.isPact}}{{localize 'DND5E.SpellProgPact'}}
              {{else}}{{localize 'DND5E.SpellLevel'}} {{lvl}}{{/if}}
              </h3>
              {{#if section.isCantrip}}
                {{else}}
                <span class="spell-detail spell-slots">
                  <input type="text" data-target="data.spells.spell{{lvl}}.value" value="{{section.value}}" placeholder="0" data-dtype="Number"/>
                  <span class="sep"> / </span>
                  <input class="spell-max" type="text" data-target="data.spells.spell{{lvl}}.override" value="{{section.max}}" placeholder="0" data-dtype="Number"/>
                </span>
              {{/if}}
            </div>
            <div class="items-header-labels">
              <div class="items-header-comps">{{localize 'TIDY5E.Components'}}</div>
              <div class="items-header-usage">{{localize 'DND5E.SpellUsage'}}</div>
            </div>
          </li>
        {{/if}}
        <ul class="item-list">
          {{#each section.spells as |spell id|}}
            {{> "modules/tidy5e-sheet/templates/favorites/item.hbs" item=spell}}
          {{/each}}
        </ul>
      {{/if}}
    {{/each}}
  {{/if}}
  </ul>
</div>