{% extends "@FerienpassAdmin/layout/base.html.twig" %}
{% set title = 'Dashboard' %}

{% block main %}
    <div class="flex flex-col lg:flex-row">
        <div class="flex-1 {% if is_granted('ROLE_ADMIN') %}lg:pr-12{% endif %}">
            <div>
                <h1 class="text-gray-900 dark:text-gray-50 tracking-tight text-3xl font-extrabold">Hi <span data-controller="ferienpass--admin-personalize"></span>!</h1>
            </div>

            {# The dashboard renders inline and is cached as one entry, kept fresh
               by the CacheTag::dashboard tag (see HomeController). next_steps
               self-gates on ROLE_ADMIN — admins get the edition/attendance
               prompts, hosts their own offers' rows. The heatmap is admin-only. #}
            <div class="mt-6 space-y-24">
                {% include "@FerienpassAdmin/fragment/dashboard/next_steps.html.twig" %}

                {% if is_granted('ROLE_ADMIN') %}
                    {% include "@FerienpassAdmin/fragment/dashboard/heatmap.html.twig" with { values: heatmapValues } only %}
                {% endif %}
            </div>
        </div>

        {% if is_granted('ROLE_ADMIN') %}
            {% include "@FerienpassAdmin/fragment/dashboard/activity_feed.html.twig" with { activities: activities } only %}
        {% endif %}
    </div>
{% endblock %}
