<div class="flex-none p-6 text-center">
    <div class="mx-auto size-16 rounded-full bg-primary-100 flex items-center justify-center text-primary-600">
        <twig:ux:icon name="ph:users" class="size-8" />
    </div>
    <h2 class="mt-3 font-semibold text-gray-900 dark:text-white">{{ item.firstname }} {{ item.lastname }}</h2>
    <p class="text-sm/6 text-gray-500 dark:text-gray-400">Teilnehmende</p>
</div>
<div class="flex flex-auto flex-col justify-between p-6">
    <dl class="grid grid-cols-1 gap-x-6 gap-y-3 text-sm text-gray-700 dark:text-gray-300">
        <dt class="col-end-1 font-semibold text-gray-900 dark:text-white">Geburtsdatum</dt>
        <dd>{{ item.dateOfBirth|default ? item.dateOfBirth|date('d.m.Y') : '-' }}</dd>
        <dt class="col-end-1 font-semibold text-gray-900 dark:text-white">Elternteil</dt>
        <dd>{{ item.user.name|default('-') }} ({{ item.user.email|default('') }})</dd>
        <dt class="col-end-1 font-semibold text-gray-900 dark:text-white">Anmeldungen</dt>
        <dd>{{ item.attendances|length }}</dd>
        <dt class="col-end-1 font-semibold text-gray-900 dark:text-white">Belege</dt>
        <dd>
            {% set receipts = [] %}
            {% for attendance in item.attendances %}
                {% for paymentItem in attendance.paymentItems %}
                    {% set payment = paymentItem.payment %}
                    {% if payment.receiptNumber and payment.id not in receipts %}
                        {% set receipts = receipts|merge([payment.id]) %}
                    {% endif %}
                {% endfor %}
            {% endfor %}
            {{ receipts|length }}
        </dd>
    </dl>
    <twig:Admin:Button href="{{ path('admin_participants_attendances', {uuid: item.uuid.toBase58}) }}" variant="primary" class="mt-6 w-full">Anmeldungen</twig:Admin:Button>
</div>
