dealroom/templates/analytics.templ

72 lines
2.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package templates
import "dealroom/internal/model"
import "fmt"
type AnalyticsStats struct {
DealCount int
FileCount int
RequestCount int
CompletionPct int
}
templ AnalyticsPage(profile *model.Profile, stats *AnalyticsStats) {
@Layout(profile, "analytics") {
<div class="space-y-5">
<div>
<h1 class="text-2xl font-bold">Analytics</h1>
<p class="text-sm text-gray-500 mt-1">Key metrics and insights across your deal portfolio.</p>
</div>
<div class="grid grid-cols-4 gap-4">
<div class="bg-gray-900 rounded-lg border border-gray-800 p-6">
<div class="text-xs text-gray-500 uppercase tracking-wider mb-2">Active Deals</div>
<div class="text-3xl font-bold text-teal-400">{ fmt.Sprintf("%d", stats.DealCount) }</div>
</div>
<div class="bg-gray-900 rounded-lg border border-gray-800 p-6">
<div class="text-xs text-gray-500 uppercase tracking-wider mb-2">Total Documents</div>
<div class="text-3xl font-bold text-blue-400">{ fmt.Sprintf("%d", stats.FileCount) }</div>
</div>
<div class="bg-gray-900 rounded-lg border border-gray-800 p-6">
<div class="text-xs text-gray-500 uppercase tracking-wider mb-2">Diligence Requests</div>
<div class="text-3xl font-bold text-amber-400">{ fmt.Sprintf("%d", stats.RequestCount) }</div>
</div>
<div class="bg-gray-900 rounded-lg border border-gray-800 p-6">
<div class="text-xs text-gray-500 uppercase tracking-wider mb-2">Request Completion</div>
<div class="text-3xl font-bold text-green-400">{ fmt.Sprintf("%d%%", stats.CompletionPct) }</div>
<div class="mt-3 w-full bg-gray-800 rounded-full h-2">
<div class="bg-green-500 h-2 rounded-full" style="width: 50%">&nbsp;</div>
</div>
</div>
</div>
<!-- Completion by Status -->
<div class="bg-gray-900 rounded-lg border border-gray-800 p-6">
<h2 class="text-sm font-semibold mb-4">Request Status Breakdown</h2>
<div class="grid grid-cols-4 gap-4">
<div class="text-center">
<div class="text-2xl mb-1">✅</div>
<div class="text-sm font-medium text-green-400">Fulfilled</div>
<div class="text-xs text-gray-500 mt-1">Items fully addressed</div>
</div>
<div class="text-center">
<div class="text-2xl mb-1">⚠️</div>
<div class="text-sm font-medium text-amber-400">Partial</div>
<div class="text-xs text-gray-500 mt-1">Partially completed</div>
</div>
<div class="text-center">
<div class="text-2xl mb-1">🔴</div>
<div class="text-sm font-medium text-red-400">Missing</div>
<div class="text-xs text-gray-500 mt-1">Not yet provided</div>
</div>
<div class="text-center">
<div class="text-2xl mb-1"></div>
<div class="text-sm font-medium text-gray-400">N/A</div>
<div class="text-xs text-gray-500 mt-1">Not applicable</div>
</div>
</div>
</div>
</div>
}
}