{
  "$schema": "../../packages/ui/screens/screen.schema.json",
  "id": "comms.sendlog",
  "version": 1,
  "app": "anfragen",
  "route": "/sende-log",
  "title": "Sende-Log",
  "data": {
    "log": {
      "source": "emails.sendLog"
    }
  },
  "body": [
    {
      "component": "page-header",
      "data": {
        "title": "Sende-Log",
        "meta": "Protokoll aller gesendeten Antworten — wer hat wann an wen geantwortet"
      }
    },
    {
      "component": "table",
      "data": {
        "caption": "Gesendete Antworten",
        "captionHidden": true,
        "columns": [
          {
            "key": "to",
            "label": "Empfänger"
          },
          {
            "key": "subject",
            "label": "Betreff"
          },
          {
            "key": "category",
            "label": "Kategorie"
          },
          {
            "key": "by",
            "label": "Gesendet von"
          },
          {
            "key": "at",
            "label": "Zeitpunkt"
          }
        ],
        "rowHeaderKey": "to",
        "rows": {
          "$each": "log.entries",
          "as": "l",
          "map": {
            "id": {
              "$bind": "l.id"
            },
            "cells": {
              "to": {
                "$text": "{l.from} · {l.fromEmail}"
              },
              "subject": {
                "$bind": "l.subject"
              },
              "category": {
                "badge": {
                  "label": {
                    "$bind": "l.category"
                  }
                }
              },
              "by": {
                "$bind": "l.sentBy"
              },
              "at": {
                "$bind": "l.sentLabel"
              }
            }
          }
        }
      }
    }
  ]
}
