{% trans_default_domain 'admin' %}
{% set translationPrefix = app.request.get('_route')|split('_')[1] %}

{% if items is not empty %}

    <ul role="list" class="divide-y divide-gray-200 dark:divide-gray-800/50">

        {% for item in items %}
            {% include '@FerienpassAdmin/components/_list_item.html.twig' with _context|merge({ item: item }) %}
        {% endfor %}

    </ul>

{% else %}

    {% set action = action|default((routeName ?? app.request.get('_route')|split('.')|first)|split('_')[2]) %}
    {% set _emptyDescriptionKey = "#{translationPrefix}.#{action}.emptyDescription" %}
    {% set _emptyDescription = _emptyDescriptionKey|trans %}
    <div class="mt-6 rounded-md border-2 border-dashed border-gray-200 dark:border-gray-800 p-12 text-center">
        <twig:ux:icon name="ph:tray" class="mx-auto size-12 text-gray-300 dark:text-gray-600" />
        <h3 class="mt-2 text-sm font-semibold text-gray-900 dark:text-white">{{ "#{translationPrefix}.#{action}.empty"|trans }}</h3>
        {% if _emptyDescription != _emptyDescriptionKey %}
            <p class="mt-1 text-sm text-gray-500 dark:text-gray-400">{{ _emptyDescription }}</p>
        {% endif %}
    </div>

{% endif %}
