{% extends 'django_spire/card/form_card.html' %}

{% block card_title_content %}
    <form x-data="{
            submit_value(value) {
                document.getElementById('delete_confirmation_should_delete').value = value
                document.getElementById('delete_form').submit()
            }
        }" id="delete_form" method="post">
        {% if form_description %}
            <div class="mb-3">
                {{ form_description }}
            </div>
        {% endif %}

        <div class="row text-center">
            {% csrf_token %}
            <input hidden id="delete_confirmation_should_delete" value="false" name="should_delete" type="text">

            <div class="col-auto me-3">
                {% include 'django_spire/button/danger_button.html' with x_button_click='submit_value(true)' button_text='Delete' %}
            </div>
            <div class="col-auto">
                {% include 'django_spire/button/secondary_button.html' with x_button_click='submit_value(false)' button_text='Cancel' %}
            </div>
        </div>
    </form>
{% endblock %}
