{% trans_default_domain 'admin' %}
{# Subject cell for the consents audit list: a type icon (the same glyph the
   admin/accounts list uses) and the subject's name. The type is the consent
   form's subject (participant / account / host); a form-less consent falls
   back to whether a participant is attached. #}
{% set p = item.participant|default(null) %}
{% set cf = item.consentForm|default(null) %}
{% set subjectType = cf ? cf.subject : (p ? 'participant' : 'account') %}
{% set name = (subjectType == 'participant')
    ? (p ? p.name : (item.signedBy|default(item.user.name|default('—'))))
    : (item.user.name|default(item.signedBy|default('—'))) %}
{# Icon glyph + colour per subject type. account/host reuse the admin/accounts
   glyph (ph:user-circle); participant gets ph:person-simple. Colours are the SAME
   as the admin/accounts role icons — host = blue-600, account = green-600 — so the
   two lists read identically; participant has no account equivalent (orange).
   Full literal strings so the Tailwind scanner keeps them. #}
{% set icon = { account: 'ph:user-circle', participant: 'ph:person-simple', host: 'ph:user-circle' }[subjectType]|default('ph:user-circle') %}
{% set iconColor = { account: 'text-green-600', participant: 'text-orange-600', host: 'text-blue-600' }[subjectType]|default('text-gray-500') %}
<span class="inline-flex min-w-0 items-center gap-x-2">
    <span aria-hidden="true" class="{{ iconColor }} size-5 inline-flex flex-none">{{ ux_icon(icon) }}</span>
    <span class="min-w-0 truncate">{{ name }}</span>
</span>
