{#
/**
* @file
* DEPRECATED
*
* This file is no longer used by any component in localgov_base.
*
* @see components/prev-next/ for the in-use component and libraries.
*
* Default theme implementation for the prev_next type blocks.
*/
#}

{% set previous_icon = previous_icon|default('chevron-left') %}
{% set next_icon = next_icon|default('chevron-right') %}
{% set previous_aria_label = 'Previous'|t ~ (previous_title ? ': ' ~ previous_title : '') %}
{% set next_aria_label = 'Next'|t ~ (next_title ? ': ' ~ next_title : '') %}

{%
  set classes = [
  'lgd-prev-next',
  prev_next_type ? 'lgd-prev-next--' ~ prev_next_type,
]
%}

{% if not localgov_base_remove_css %}
  {{ attach_library('localgov_base/prev-next') }}
{% endif %}

<nav{{attributes.addClass(classes)}}>
  <ul class="lgd-prev-next__list">
    {% if previous_url %}
      <li class="lgd-prev-next__list-item lgd-prev-next__list-item--prev">
        <a href="{{ previous_url }}" class="lgd-prev-next__link lgd-prev-next__link--prev" aria-label="{{ previous_aria_label }}">
          {% include "@localgov_base/includes/icons/icon.html.twig" with {
            icon_name: previous_icon,
            icon_classes: 'lgd-prev-next__icon lgd-prev-next__icon--prev',
          }
          %}
          <div class="lgd-prev-next__label">
            {{ 'Previous'|t }}
          </div>
          {% if show_title == 1 %}
            <div class="lgd-prev-next__title">
              {{ previous_title }}
            </div>
          {% endif %}
        </a>
      </li>
    {% endif %}
    {% if next_url %}
      <li class="lgd-prev-next__list-item lgd-prev-next__list-item--next">
        <a href="{{ next_url }}" class="lgd-prev-next__link lgd-prev-next__link--next" aria-label="{{ next_aria_label }}">
          <div class="lgd-prev-next__label">
            {{ 'Next'|t }}
          </div>
          {% include "@localgov_base/includes/icons/icon.html.twig" with {
            icon_name: next_icon,
            icon_classes: 'lgd-prev-next__icon lgd-prev-next__icon--next',
          }
          %}
          {% if show_title == 1 %}
            <div class="lgd-prev-next__title">
              {{ next_title }}
            </div>
          {% endif %}
        </a>
      </li>
    {% endif %}
  </ul>
</nav>
