{% macro translationForm(translations) %}
    {% import '@SyliusUi/Macro/flags.html.twig' as flags %}

    <div class="ui styled fluid accordion">
        {% for locale, translationForm in translations %}
            <div data-locale="{{ locale }}">
                <div class="title{% if loop.first %} active{% endif %}">
                    <i class="dropdown icon"></i>
                    {{ flags.fromLocaleCode(locale) }} {{ locale|sylius_locale_name }}
                </div>
                <div class="ui content{% if loop.first %} active{% endif %}">
                    {% for field in translationForm %}
                        {{ form_row(field) }}
                    {% endfor %}
                </div>
            </div>
        {% endfor %}
    </div>
{% endmacro %}

{% macro translationFormWithSlug(translations, slugFieldTemplate, resource) %}
    {% import '@SyliusUi/Macro/flags.html.twig' as flags %}

    <div class="ui styled fluid accordion">
        {% for locale, translationForm in translations %}
            <div data-locale="{{ locale }}">
                <div class="title{% if loop.first %} active{% endif %}">
                    <i class="dropdown icon"></i>
                    {{ flags.fromLocaleCode(locale) }} {{ locale|sylius_locale_name }}
                </div>
                <div class="ui content{% if loop.first %} active{% endif %}">
                    {% for field in translationForm %}
                        {% if field.vars.name != 'slug' %}
                            {{ form_row(field) }}
                        {% else %}
                            {% include slugFieldTemplate with { 'slugField': translationForm.slug, 'resource': resource } %}
                        {% endif %}
                    {% endfor %}
                </div>
            </div>
        {% endfor %}
    </div>
{% endmacro %}
