{# @var group \EasyCorp\Bundle\EasyAdminBundle\Dto\ActionGroupDto #}
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
{% set has_main_action = group.hasMainAction %}
{% set main_action = group.mainAction %}
{% if has_main_action %} {# render as a split button (main button with action + dropdown toggle) #}
{% set main_action_label = main_action.label|trans %}
{%- if main_action_label is not same as(false) -%}{{ main_action_label|raw }}{%- endif -%}
{{ 'action.toggle_dropdown'|trans }}
{% else %} {# render as a single button that toggles the dropdown (no main action) #}
{% set group_label = group.label|trans %}
{%- if group_label is not same as(false) -%}{{ group_label|raw }}{%- endif -%}
{% endif %}
{% for item in group.items %}
{% if item is iterable and item.type is defined %}
{% if item.type == 'divider' %}
{% elseif item.type == 'header' %}
{% set item_label = item.content|trans %}
{% endif %}
{% else %}
{# item is an ActionDto #}
{% endif %}
{% endfor %}