{% extends '@MauticForm/Action/base_form_action.html.twig' %}

{% set footerContent %}
    {% if action.properties.add_tags is defined and action.properties.add_tags is not empty and securityIsGranted('tagManager:tagManager:view') %}
        <!-- Add tags -->
        {% for tagName in action.properties.add_tags %}
            {% include '@MauticCore/Helper/_tag.html.twig' with {
                'tags': [{
                    'label': tagName,
                    'color': 'green',
                    'icon': 'ri-pie-chart-line'
                }]
            } %}
        {% endfor %}
    {% endif %}

    {% if action.properties.remove_tags is defined and action.properties.remove_tags is not empty and securityIsGranted('tagManager:tagManager:view') %}
        <!-- Remove tags -->
        {% for tagName in action.properties.remove_tags %}
            {% include '@MauticCore/Helper/_tag.html.twig' with {
                'tags': [{
                    'label': tagName,
                    'color': 'red',
                    'icon': 'ri-pie-chart-line'
                }]
            } %}
        {% endfor %}
    {% endif %}
{% endset %}

{% block action_label %}
    {{ footerContent|raw }}
{% endblock %}
