{% trans_default_domain 'admin' %}

{#
  Postausgang — a two-pane mail client over the system's sent messages.
  Shared lookup maps (status + engagement-event presentation) live here and are
  passed down to the included partials via the render context.
#}
{% set statusMeta = {
    gesendet:   { label: 'outbox.status.gesendet',   dot: 'bg-gray-400',    text: 'text-gray-500 dark:text-gray-400' },
    zugestellt: { label: 'outbox.status.zugestellt', dot: 'bg-sky-500',     text: 'text-sky-600 dark:text-sky-400' },
    geoeffnet:  { label: 'outbox.status.geoeffnet',  dot: 'bg-emerald-500', text: 'text-emerald-600 dark:text-emerald-400' },
    geklickt:   { label: 'outbox.status.geklickt',   dot: 'bg-violet-500',  text: 'text-violet-600 dark:text-violet-400' },
    bounce:     { label: 'outbox.status.bounce',     dot: 'bg-red-500',     text: 'text-red-600 dark:text-red-400' },
} %}
{% set eventMeta = {
    sent:        { label: 'Gesendet',           dot: 'bg-gray-400',    text: 'text-gray-400 dark:text-gray-500',       icon: 'ph:paper-plane-tilt' },
    delivered:   { label: 'Zugestellt',         dot: 'bg-sky-500',     text: 'text-sky-600 dark:text-sky-400',         icon: 'ph:check' },
    open:        { label: 'Geöffnet',           dot: 'bg-emerald-500', text: 'text-emerald-600 dark:text-emerald-400', icon: 'ph:eye' },
    click:       { label: 'Link geklickt',      dot: 'bg-violet-500',  text: 'text-violet-600 dark:text-violet-400',   icon: 'ph:cursor-click' },
    bounce:      { label: 'Unzustellbar',       dot: 'bg-red-500',     text: 'text-red-600 dark:text-red-400',         icon: 'ph:x' },
    dropped:     { label: 'Verworfen',          dot: 'bg-red-500',     text: 'text-red-600 dark:text-red-400',         icon: 'ph:x' },
    deferred:    { label: 'Zurückgestellt',     dot: 'bg-amber-500',   text: 'text-amber-600 dark:text-amber-400',     icon: 'ph:clock-countdown' },
    unsubscribe: { label: 'Abgemeldet',         dot: 'bg-orange-500',  text: 'text-orange-600 dark:text-orange-400',   icon: 'ph:user-minus' },
    spam:        { label: 'Als Spam markiert',  dot: 'bg-orange-500',  text: 'text-orange-600 dark:text-orange-400',   icon: 'ph:warning' },
} %}

<div {{ attributes.defaults({ class: 'space-y-5' }) }}>

    {{ include('@FerienpassAdmin/components/outbox/_stats.html.twig') }}

    {{ include('@FerienpassAdmin/components/outbox/_controls.html.twig') }}

    {% if kind == 'transactional' %}
        {{ include('@FerienpassAdmin/components/outbox/_typechips.html.twig') }}
    {% endif %}

    <div class="grid grid-cols-1 lg:grid-cols-[372px_minmax(0,1fr)] lg:grid-rows-1 overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 lg:h-[72vh] lg:min-h-[560px] lg:max-h-[860px]">
        {{ include('@FerienpassAdmin/components/outbox/_list.html.twig') }}
        {{ include('@FerienpassAdmin/components/outbox/_detail.html.twig') }}
    </div>

</div>
