feat: admin dashboard widgets

This commit is contained in:
Björn Fromme
2026-08-25 16:31:45 +02:00
parent 578a21d327
commit 4e6aaba9ff
17 changed files with 808 additions and 6 deletions
@@ -0,0 +1,13 @@
{% set url = url ?? null %}
{% set icon = icon ?? null %}
{% set body %}
{% if icon %}{{ icon(icon, 'w-4 h-4 shrink-0') }}{% endif %}
<span class="whitespace-nowrap">{{ block('content') }}</span>
{% endset %}
<li class="py-2 first:pt-0 last:pb-0 overflow-x-hidden">
{% if url %}
<a href="{{ url }}" {{ attributes.defaults({class: 'flex items-center space-x-1'}).without('url', 'icon') }}>{{ body }}</a>
{% else %}
<div {{ attributes.defaults({class: 'flex items-center space-x-1'}).without('url', 'icon') }}>{{ body }}</div>
{% endif %}
</li>
@@ -0,0 +1,15 @@
{% 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>