{# @var icon \EasyCorp\Bundle\EasyAdminBundle\Dto\IconDto #}
<span {{ attributes.defaults({class: 'icon'}) }}>
    {% set icon = this.getIcon() %}
    {% if icon.isFontAwesomeIconSet %}
        <i class="{{ icon.name }}"></i>
    {% elseif icon.svgContents %}
        {{ icon.svgContents|raw }}
    {% else %}
        {# TODO: replace this by a call to ux_icon() function directly when Twig 3.15 is released and we can use the 'guard' tag #}
        {{ ea_ux_icon(icon.name, attributes.all) }}
    {% endif %}
</span>
