{% extends 'djf_surveys/admins/master.html' %}

{% block content %}
    <div class="container px-5 py-5 ">
        {% include 'djf_surveys/components/section_welcome.html' %}

        <section>
            <div class="py-6 lg:items-end justify-between flex">
                <h2 class="max-w-xl text-2xl font-bold sm:text-3xl">
                    Create a survey
                </h2>

                <a href="{% url 'djf_surveys:admin_create_survey' %}" class="inline-block px-5 py-3 mt-4 font-medium text-white bg-blue-500 rounded-lg sm:m-0">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
                         stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                              d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
                    </svg>
                </a>
            </div>
        </section>

        {% include 'djf_surveys/components/search_form.html' %}
        {% if object_list %}
            <div class="grid xs:grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-2 gap-4">
                {% for survey in page_obj %}
                    {% include 'djf_surveys/components/card_list_survey.html' %}
                {% endfor %}
            </div>
            <div class="py-10">
                {% include 'djf_surveys/components/pagination.html' %}
            </div>
        {% else %}
            {% include 'djf_surveys/components/empty_state.html' %}
        {% endif %}
    </div>

    {% include 'djf_surveys/components/modal_delete.html' %}

{% endblock %}

{% block extra_js %}
    {% include 'djf_surveys/components/modal_delete_js.html' %}
{% endblock %}