{% for entry in logs | reverse %}
  <tr>
    <td>
      <span class="ht-badge ht-badge--sm {% if entry.level == 'DEBUG' %}ht-log-debug {% elif entry.level == 'INFO' %}ht-log-info {% elif entry.level == 'WARNING' %}ht-log-warning {% elif entry.level == 'ERROR' %}ht-log-error {% elif entry.level == 'CRITICAL' %}ht-log-critical {% endif %}">
        {{ entry.level }}
      </span>
    </td>
    <td>
      {% if entry.timestamp %}
        <time x-data
              x-text="new Date({{ entry.timestamp }} * 1000).toLocaleTimeString()"></time>
      {% else %}
        —
      {% endif %}
    </td>
    {% if show_app_column | default(true) %}
      <td>
        {% if entry.app_key %}
          <a href="/ui/apps/{{ entry.app_key }}"><code>{{ entry.app_key }}</code></a>
        {% else %}
          <code>—</code>
        {% endif %}
      </td>
    {% endif %}
    <td>{{ entry.message }}</td>
  </tr>
{% else %}
  <tr>
    <td colspan="{{ 4 if show_app_column | default(true) else 3 }}"
        class="ht-text-center ht-text-muted">No log entries.</td>
  </tr>
{% endfor %}
