{% macro toaster( id="toaster", toasts=[], main_attrs=None, is_fragment=false, include_script=false, register_on=["alpine:init"] ) %} {% if not is_fragment and include_script %} {% include "components/toast-script.njk" %} {% endif %} {% set icons = { 'success': '', 'error': '', 'info': '', 'warning': '' } %}
{% for toast in toasts %}
{% if toast.category in ["error", "success", "info", "warning"] %} {{ icons[toast.category] | safe }} {% endif %}
{% if toast.title %}

{{ toast.title }}

{% endif %} {% if toast.description %}

{{ toast.description }}

{% endif %}
{% if toast.action or toast.cancel %} {% endif %}
{% endfor %}
{% if not is_fragment %}