{% load static wagtailcore_tags %}

{% with buttons=block.value|default:block %}
  {% if buttons %}
    {% with icons_side=buttons.0.value.icon_side %}
      {% if buttons|length > 1 %}
        <ul class="fr-btns-group fr-btns-group--inline-lg{% if icons_side == 'fr-btn--icon-left' %} fr-btns-group--icon-left{% elif icons_side == 'fr-btn--icon-right' %} fr-btns-group--icon-right{% endif %}">
          {% for button in buttons %}
            <li>{% include "sites_conformes_content_manager/blocks/button.html" with button=button.value %}</li>
          {% endfor %}
        </ul>
      {% else %}
        <div class="fr-btns-group fr-btns-group--inline-lg{% if icons_side == 'fr-btn--icon-left' %} fr-btns-group--icon-left{% elif icons_side == 'fr-btn--icon-right' %} fr-btns-group--icon-right{% endif %}">
          {% include "sites_conformes_content_manager/blocks/button.html" with button=buttons.0.value %}
        </div>
      {% endif %}
    {% endwith %}
  {% endif %}
{% endwith %}
