{% extends "base.html" %}

{% block title %}Statistik - VideoKonverter{% endblock %}

{% block content %}
<section class="stats-section">
    <h2>Statistik</h2>

    <!-- Zusammenfassung -->
    {% if summary %}
    <div class="stats-summary">
        <div class="stat-card">
            <span class="stat-value">{{ summary.total }}</span>
            <span class="stat-label">Gesamt</span>
        </div>
        <div class="stat-card">
            <span class="stat-value">{{ summary.finished }}</span>
            <span class="stat-label">Erfolgreich</span>
        </div>
        <div class="stat-card">
            <span class="stat-value">{{ summary.failed }}</span>
            <span class="stat-label">Fehlgeschlagen</span>
        </div>
        <div class="stat-card">
            <span class="stat-value">{{ "%.1f"|format(summary.space_saved / 1073741824) }} GiB</span>
            <span class="stat-label">Platz gespart</span>
        </div>
        <div class="stat-card">
            <span class="stat-value">{{ "%.1f"|format(summary.avg_fps) }}</span>
            <span class="stat-label">Avg FPS</span>
        </div>
        <div class="stat-card">
            <span class="stat-value">{{ "%.2f"|format(summary.avg_speed) }}x</span>
            <span class="stat-label">Avg Speed</span>
        </div>
    </div>
    {% endif %}

    <!-- Tabelle -->
    <div id="stats-table"
         hx-get="/htmx/stats?page=1"
         hx-trigger="load"
         hx-swap="innerHTML">
        Lade Statistiken...
    </div>
</section>
{% endblock %}
