Files

16 lines
667 B
Twig

{% set emptyText = emptyText ?? 'Keine Einträge vorhanden.' %}
{% set entries %}{% block content %}{% endblock %}{% endset %}
<div {{ attributes.defaults({class: 'bg-gray-100 border border-gray-200 rounded-md px-4 py-2'}).without('title', 'emptyText') }}>
<h2 class="flex justify-between pb-2">
<span class="font-bold text-lg">{{ title }}</span>
{% block actions %}{% endblock %}
</h2>
{% if entries|trim is empty %}
{% block empty %}
<p class="py-2 text-sm text-gray-500">{{ emptyText }}</p>
{% endblock %}
{% else %}
<ul class="divide-y divide-gray-200">{{ entries }}</ul>
{% endif %}
</div>