{#
/**
 * @file
 * Template for status messages.
 */
#}
{% set types = {
  status: 'success',
  warning: 'warning',
  error: 'danger',
  info: 'info',
} %}

{% for type, messages in message_list %}
  <div role="region" aria-label="{{ status_headings[type] }}"{{ attributes|without('role', 'aria-label') }}>

    {% embed 'sector_theme:alert' with {
      type: types[type],
      libraries: []
    } %}
      {% block content %}
        {% if status_headings[type] %}
          <h2 class="sr-only">{{ status_headings[type] }}</h2>
        {% endif %}
        {% if messages|length > 1 %}
          <ul>
            {% for message in messages %}
              <li>{{ message }}</li>
            {% endfor %}
          </ul>
        {% else %}
          {{ messages|first }}
        {% endif %}
      {% endblock %}
    {% endembed %}
  </div>
{% endfor %}

