{% from "macros/ui.html" import status_badge, action_buttons %}
{% if app %}
  <tr id="app-row-{{ app.app_key }}">
    <td>
      <code>{{ app.app_key }}</code>
    </td>
    <td>{{ app.class_name }}</td>
    <td>{{ status_badge(app.status) }}</td>
    <td>
      {% if app.error_message %}
        <span class="ht-text-danger ht-text-xs">{{ app.error_message }}</span>
      {% else %}
        —
      {% endif %}
    </td>
    <td>
      {{ action_buttons(app.app_key, app.status, after_action="htmx.trigger('#app-list', 'htmx:load')", show_labels=false) }}
    </td>
  </tr>
{% else %}
  <tr>
    <td colspan="5" class="ht-text-center ht-text-muted">App not found.</td>
  </tr>
{% endif %}
