{% trans_default_domain 'admin' %}

{% set items = [] %}
{% for e in events %}
    {% set em = eventMeta[e.event]|default(eventMeta.sent) %}
    {% set subtitle %}{% if withName|default(false) and e.name is defined %}{{ 'outbox.byRecipient'|trans({ name: e.name }) }}{% if e.reason and not e.link %} · {{ e.reason }}{% endif %}{% elseif e.reason and not e.link %}{{ e.reason }}{% endif %}{% endset %}
    {% set items = items|merge([{
        icon: em.icon,
        color: em.text,
        title: em.label,
        subtitle: subtitle|trim,
        link: e.link|default(null),
        time: e.timestamp|ago,
    }]) %}
{% endfor %}

<twig:Admin:Timeline :items="items" />
