{# LIBRARIES #}
{{ attach_library('ui_patterns/jc_dropdown.jc_base') }}
{{ attach_library('ui_patterns/jc_modal.jc_modal_lib') }}

{% set uid = uid|default('') %}
{% set pid = pid|default('') %}

<div class="disruptions">

  {% if element.descriptions|length %}
    {% for item in element.descriptions %}
      {% include '@organisms/tm-jc/jc-modal/jc-modal-route/journey-check-description.html.twig' with {
        'description': item,
        'route': element,
        'uid': uid,
        'pid': pid,
      } only %}
    {% endfor %}
  {% endif %}

  {% if element.descriptions|length and element.incidentLists|length %}
    <hr>
  {% endif %}

  {% if element.incidentLists|length %}
    {% for item in element.incidentLists %}
      {% include '@organisms/tm-jc/jc-modal/jc-modal-incident/journey-check-incident-list.html.twig' with {
        'incidentList': item,
        'route': element,
        'uid': uid,
        'pid': pid,
      } only %}
    {% endfor %}
  {% endif %}

  {% if element.incidentLists|length and element.moreInfoText %}
    <hr>
  {% endif %}

  {% if element.moreInfoText %}
    {{ element.moreInfoText|jc_header_level(3)|raw }}
  {% endif %}

</div>
