{{! Effects Section }}
{{log 'item-effects-ro.hbs' effects}}

<div class="section" style="display: inline-block; margin: 5px; min-width: 580px;">
  <div class="section-head">
    <h2 class="section-title">{{ localize 'shadowrun6.effect.Label' }}</h2>
  </div>

  <section class='effects'>
    <ol class='effects-list'>
      {{#each effects as |section sid|}}
        <li class='effects-header flexrow' data-effect-type='{{section.type}}'>
          <div class='effect-name flexrow'>{{localize section.label}}</div>
          {{#iff ../item.type '!=' "mod"}}
          <div class='effect-source'>{{localize 'shadowrun6.effect.Source'}}</div>
          {{/iff}}
          <div class='effect-duration'>{{localize 'shadowrun6.effect.Duration'}}</div>
          <div class='effect-controls effect-controls flexrow'>
            <span
              class='effect-control'
              data-action='createDoc'
              data-document-class='ActiveEffect'
              {{#if (eq section.type "inactive")}}
                data-disabled="true"
              {{else if (eq section.type "temporary")}}
                data-duration.rounds="1"
              {{/if}}
              title='{{localize 'shadowrun6.effect.Create' }}'
            >
              <i class='fa-solid fa-plus'></i>
              {{localize 'shadowrun6.effect.New' }}
            </span>
          </div>
        </li>
        <ol class='effect-list'>
          {{#each section.effects as |effect|}}
            <li
              class='item effect flexrow'
              data-effect-id='{{effect.id}}'
              data-parent-id='{{effect.parent.id}}'
              data-drag="true"
            >
              <div class='effect-name flexrow'>
                <img class='effect-image' src='{{effect.img}}' />
                <div>{{effect.name}}</div>
              </div>
              {{#iff ../../item.type '!=' "mod"}}
              <div class='effect-source'>
                {{effect.system.sourceName}} {{#iff effect.parent.type '==' "mod"}}<span class="item-control item-edit" title={{localize 'shadowrun6.label.edit' }}><i class="fa-solid fa-edit"></i></span>{{/iff}}
                </div>
              {{/iff}}
              <div class='effect-duration'>
                {{#iff effect.duration.type '==' "none"}}
                <i class="fa-solid fa-infinity" title="{{effect.duration.label}}"></i>
                {{else}}
                {{effect.duration.label}}
                {{/iff}}
              </div>
              <div class='effect-controls effect-controls flexrow'>
                <span
                  class='effect-control'
                  title='{{localize "shadowrun6.effect.Toggle"}}'
                >
                  <i class='fas {{#if effect.disabled}}fa-toggle-off{{else}}fa-toggle-on{{/if}}'></i>
                </span>
                <span
                  class='effect-control'
                  title='{{localize "DOCUMENT.Update" type=(localize "shadowrun6.effect.Label_one")}}'
                >
                  <i class='fa-solid fa-edit'></i>
                </span>
                {{#iff effect.parent.type '==' "mod"}}
                  {{#iff ../../item.type '==' "mod"}}
                  <span
                    class='effect-control'
                    title='{{localize "DOCUMENT.Delete" type=(localize "shadowrun6.effect.Label_one")}}'
                  >
                    <i class='fa-solid fa-trash'></i>
                  </span>
                  {{else}}
                  <span class='effect-control disabled' title='{{localize "shadowrun6.effect.CantDelete"}}'><i class='fa-solid fa-trash'></i></span>
                  {{/iff}}
                {{else}}
                  <span
                    class='effect-control'
                    title='{{localize "DOCUMENT.Delete" type=(localize "shadowrun6.effect.Label_one")}}'
                  >
                    <i class='fa-solid fa-trash'></i>
                  </span>
                {{/iff}}
              </div>
            </li>
          {{/each}}
        </ol>
      {{/each}}
    </ol>
  </section>

</div>