{% macro component(config, localized) %}
    {% embed "system/embed/table/responsive-table.html.twig" %}
        {% block heading %}
            {% embed "system/embed/table/table-header-element.html.twig" %}
                {% block content %}
                    {{ localized.table.name | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" %}
                {% block content %}
                    {{ localized.table.id | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" %}
                {% block content %}
                    {{ localized.table.handles | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" %}
                {% block content %}
                    {{ localized.table.phrases | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" with {textAlign: 'bc-text-center'} %}
                {% block content %}
                    {{ localized.table.status | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" with {textAlign: 'bc-text-center'} %}
                {% import "system/macro/icons/trash.html.twig" as trash_icon %}
                {% block content %}
                    {{ trash_icon.component({}) }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" with {textAlign: 'bc-text-center'} %}
                {% import "system/macro/icons/edit.html.twig" as edit_icon %}
                {% block content %}
                    {{ edit_icon.component({}) }}
                {% endblock %}
            {% endembed %}
        {% endblock %}
        {% block body %}
            {% if config.styleBlockers is empty %}
                <tr>
                    <td colspan="7" class="bc-py-4 bc-text-center">
                        {{ localized.alert.noStyleBlockerConfigured | raw }}
                    </td>
                </tr>
            {% else %}
                {% for styleBlocker in config.styleBlockers %}
                    {% embed "system/embed/table/table-body-row.html.twig" %}
                        {% block rowContent %}
                            {% embed "system/embed/table/table-body-element.html.twig" %}
                                {% block content %}
                                    {{ styleBlocker.name }}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" %}
                                {% block content %}
                                    {{ styleBlocker.key }}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" %}
                                {% block content %}
                                    {% if styleBlocker.handles.list is not empty %}
                                        {{ styleBlocker.handles.list | column('key') | join(', ') }}
                                    {% endif %}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" %}
                                {% block content %}
                                    {% if styleBlocker.phrases.list is not empty %}
                                        {{ styleBlocker.phrases.list | column('value') | join(', ') }}
                                    {% endif %}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" with {textAlign: 'bc-text-center'} %}
                                {% import "system/macro/table/toggle-switch.html.twig" as toggle_switch %}
                                {% block content %}
                                    {{ toggle_switch.component({
                                        status: styleBlocker.status,
                                        href:  wpNonceUrl("?page=#{config.controllerId}&action=switch-status&id=#{styleBlocker.id}", "#{config.controllerId}-#{styleBlocker.id}-switch-status")
                                    }) }}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" with {textAlign: 'bc-text-center'} %}
                                {% import "system/macro/icons/trash.html.twig" as trash_icon %}
                                {% block content %}
                                    {% if not styleBlocker.undeletable %}
                                        <button
                                            data-brlbs-modal-target="{{ 'borlabsModalDelete-' ~ styleBlocker.id }}">
                                            {{ trash_icon.component({}) }}
                                        </button>
                                        {% embed "system/embed/modal/modal.html.twig" with {
                                            action: wpNonceUrl("?page=#{config.controllerId}&action=delete&id=#{styleBlocker.id}", "#{config.controllerId}-#{styleBlocker.id}-delete"),
                                            buttonText: localized.global.button.delete,
                                            id: 'borlabsModalDelete-' ~ styleBlocker.id,
                                            title: localized.global.headline.deleteSelection,
                                        } %}
                                            {% block description %}
                                                <p class="bc-text-sm"><strong>{{ localized.table.name | raw }}
                                                        :</strong> {{ styleBlocker.name }}</p>
                                                <p class="bc-text-sm"><strong>{{ localized.table.id | raw }}
                                                        :</strong> {{ styleBlocker.key }}</p>
                                            {% endblock %}
                                            {% block formData %}
                                                <input type="hidden" name="id" value="{{ styleBlocker.id }}">
                                            {% endblock %}
                                        {% endembed %}
                                    {% else %}
                                        -
                                    {% endif %}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" with {textAlign: 'bc-text-center'} %}
                                {% import "system/macro/icons/edit.html.twig" as edit_icon %}
                                {% block content %}
                                    <a href="{{ wpNonceUrl("?page=#{config.controllerId}&action=edit&id=#{styleBlocker.id}", "#{config.controllerId}-#{styleBlocker.id}-edit") | raw }}">
                                        {{ edit_icon.component({}) }}
                                    </a>
                                {% endblock %}
                            {% endembed %}
                        {% endblock %}
                    {% endembed %}
                {% endfor %}
            {% endif %}
        {% endblock %}
    {% endembed %}
{% endmacro %}
