{# flash_messages.html.j2 #}
{% for flash in get_flash_messages(request) %}
    <div class="alert alert-{{ flash.category }} alert-dismissible" role="alert">
        <div class="d-flex gap-2 align-items-start">
            {% if flash.category == 'danger' %}
                <i class="ti ti-alert-circle flex-shrink-0 mt-1"></i>
            {% elif flash.category == 'warning' %}
                <i class="ti ti-alert-triangle flex-shrink-0 mt-1"></i>
            {% elif flash.category == 'success' %}
                <i class="ti ti-circle-check flex-shrink-0 mt-1"></i>
            {% else %}
                <i class="ti ti-info-circle flex-shrink-0 mt-1"></i>
            {% endif %}
            <div>
                {{ flash.message }}
                {% if flash.exception %}
                    <pre class="mt-2 mb-0 small">{{ flash.exception }}</pre>
                {% endif %}
            </div>
        </div>
        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
    </div>
{% endfor %}
