{% embed '@theme/embeds/modal.html.twig' %}
    {% set used = used|default(false) %}
    {% block modal_id %}form_modal{% endblock %}
    {% block modal_before %}{{ form_start(form) }}{% endblock %}
    {% block modal_title %}
        {{ title|default('confirm.delete'|trans) }}
    {% endblock %}
    {% block modal_body %}
        {% if delete_item_name is defined %}
            <p><strong>{{ delete_item_name }}</strong></p>
        {% endif %}
        {% if used is same as (false) %}
            {{ 'delete.not_in_use'|trans }}
            <div class="d-none">
                {{ form_widget(form) }}
            </div>
        {% else %}
            <p>{{ message }}</p>
            {{ form_widget(form) }}
        {% endif %}
    {% endblock %}
    {% block modal_footer %}
        <button type="submit" class="btn {% if used %}btn-danger{% else %}btn-primary{% endif %} pull-left modal-form-save" data-loading-text="{{ 'delete'|trans }}..." id="{{ block('modal_id') }}_save">{{ 'delete'|trans }}</button>
        <button type="button" class="btn btn-cancel" data-bs-dismiss="modal">{{ 'action.close'|trans }}</button>
    {% endblock %}
    {% block modal_end %}{{ form_end(form) }}{% endblock %}
{% endembed %}
