<div class="topbar-actions d-inline-flex">
  {% for action in headActions|default([]) %}
    {% if action.action == 'exportFields' %}
      {{ form_start(exportForm) }}
      <div class="d-flex" id="export-action">
        <div>
          {{ form_row(exportForm.fields) }}
        </div>
        <div class="input-group-append">
          <button type="submit" class="btn btn-primary btn-icon-split rounded-left">
            <span class="text">{% if action.name is defined %}{{ action.name }}{% else %}Name missing{% endif %}</span>
          </button>
        </div>
      </div>
      {{ form_end(exportForm) }}
    {% else %}
      <a href="{% if action.link is defined %}{{ action.link }}{% else %}#{% endif %}"
         class="btn btn-{% if action.buttonColor is defined %}{{ action.buttonColor }}{% else %}secondary{% endif %} {{ action.classes|default('') }}"
          {{ action.attributesString|default()|raw }}
      >
        {% if action.icon|default('') is not empty %}
          <span class="icon mr-2"><i class="{{ action.icon|default('') }}"></i></span>
        {% endif %}
        <span class="text">{% if action.name is defined %}{{ action.name }}{% else %}Name missing{% endif %}</span>
      </a>
    {% endif %}
  {% endfor %}
</div>