{{define "title"}}Dashboard{{end}}

{{define "content"}}
<h1>Dashboard</h1>

<div class="stats">
    <div class="stat-card">
        <div class="label">Repositories</div>
        <div class="value">{{.RepoCount}}</div>
    </div>
    <div class="stat-card">
        <div class="label">Total Size</div>
        <div class="value">{{.TotalSize}}</div>
    </div>
</div>

<h2>Recent Activity</h2>
{{if .Events}}
<table>
    <thead>
        <tr>
            <th>Time</th>
            <th>Type</th>
            <th>Actor</th>
            <th>Repository</th>
            <th>Digest</th>
        </tr>
    </thead>
    <tbody>
        {{range .Events}}
        <tr>
            <td>{{formatTime .EventTime}}</td>
            <td>{{.EventType}}</td>
            <td>{{.ActorId}}</td>
            <td>{{.Repository}}</td>
            <td class="truncated">{{truncate .Digest 24}}</td>
        </tr>
        {{end}}
    </tbody>
</table>
{{else}}
<p>No recent activity.</p>
{{end}}
{{end}}
