{% trans_default_domain 'admin' %}

{# Small user-circle icon indicating the account's "primary" role. When an
   account wears multiple hats we pick the most-privileged one (admin → host
   → member) so the icon stays a single glyph next to the name. #}
{% if 'ROLE_ADMIN' in item.roles %}
    {% set color = 'text-red-600' %}
    {% set label = 'accounts.ROLE_ADMIN' %}
{% elseif 'ROLE_HOST' in item.roles %}
    {% set color = 'text-blue-600' %}
    {% set label = 'accounts.ROLE_HOST' %}
{% elseif 'ROLE_MEMBER' in item.roles %}
    {% set color = 'text-green-600' %}
    {% set label = 'accounts.ROLE_MEMBER' %}
{% else %}
    {% set color = null %}
{% endif %}

{% if color %}
    <span aria-hidden="true"
          title="{{ label|trans([], 'admin') }}"
          class="{{ color }} {{ size|default('size-5') }} inline-flex">
        {{ ux_icon('ph:user-circle') }}
    </span>
{% endif %}
