{% set link = _args.link %}
{% set title = _args.title %}
{% set active = _args.active|default(false) %}
{% set items = _args.items|default([])|filter((item) => item is not empty) %}
{% set target = _args.target|default(null) %}
{% if items %}
{% for item in items %}
{% if item.active|default(false) %}
{% set active = true %}
{% endif %}
{% endfor %}
{% endif %}
<li class="{% if items %}aside__dropdown{% if active %} aside__dropdown--active{% endif %}{% endif %}">
<a
class="{% if active %}active{% endif %}"
href="{{ link|e('html_attr') }}"
{% if target %}target="{{ target|e('html_attr') }}"{% endif %}
>
<span>{{ title }}</span>
</a>
{% if items %}
<span class="aside__dropdown--toggle">
<i class="icon-chevron-down"></i>
</span>
<ul class="aside__dropdown--list">
{% for item in items %}
{% include '@ui2022/schoolnow/side__menu--alt__item.html.twig' with item %}
{% endfor %}
</ul>
{% endif %}
</li>