{#
/**
* @file
* tag-item
*/
#}
{% set fade = fade|default(false) %}
{% set first = first|default(false) %}
{% set no_open = no_open|default(false) %}
{% set show_close = show_close|default(false) %}
{% set closer = closer|default('<i class="fas fa-times-circle"></i>') %}
{% set closer_btn = false %}
{% if no_open %}{% set first = false %}{% endif %}
{% set content_attributes = content_attributes|default(create_attribute()) %}
{% set content_attributes = content_attributes
  .setAttribute("aria-labelledby", "tbt-#{ tbid }")
  .setAttribute("role", "tabpanel")
  .setAttribute("id", "tbi-#{ tbid }")
%}

{% set content_class = [
  content_class|default(""),
  first ? 'show active',
  fade ? 'fade',
  'tab-pane',
] %}

{% if show_close and closer %}
  {% set closer_btn %}
    <button class="tb-clsr icon-button"
            type="button"
            tabindex="0"
            aria-controls="tbi-tbh-{{ tbid }}"
    >{{ closer|raw }}</button>
  {% endset %}
{% endif %}

{# TEMPLATE #}
<div {{ content_attributes }} class="{{ content_class|join(' ') }}" >
  {{ closer_btn }}
  {{ content|raw }}
</div>
