{{#each displayItems as |item|}}
  <span class='pill-input__item' data-test={{hook 'pill-item'}}>
    {{#if displayKey}}
      {{get item displayKey}}
    {{else if formatItem}}
      {{compute formatItem item}}
    {{else}}
      {{item}}
    {{/if}}

    {{#if removeItem}}
      <button
          class="pill-input__item__remove-btn"
          type='button'
          aria-label="remove element"
          data-test={{hook 'pill-item-remove-btn'}}
          onclick={{action removeItem item}}>
        &times;
      </button>
    {{/if}}
  </span>
{{/each}}

{{#if overLimit}}
  {{#if showAll}}
    <span class='pill-input__item' data-test={{hook 'pill-hide-overflow'}}>
      <button
          class="pill-input__item__overflow-btn"
          type='button'
          aria-label="hide overflow"
          data-test={{hook 'pill-item-hide-overflow-btn'}}
          onclick={{action set 'showAll' false}}>
        &minus;
      </button>
    </span>
  {{else}}
    <span class='pill-input__item' data-test={{hook 'pill-show-overflow'}}>
      <button
          class="pill-input__item__overflow-btn"
          type='button'
          aria-label="show all"
          data-test={{hook 'pill-item-show-all-btn'}}
          onclick={{action set 'showAll' true}}>
        &plus; {{countOverLimit}}
      </button>
    </span>
  {{/if}}
{{/if}}
