package templates import "dealroom/internal/model" import "fmt" import "time" templ Dashboard(profile *model.Profile, deals []*model.Deal, activities []*model.DealActivity, fileCounts map[string]int, lastActivity map[string]*time.Time) { @Layout(profile, "dashboard") {

Dashboard

Overview of all active deal rooms and recent activity.

@statCard("ACTIVE ROOMS", fmt.Sprintf("%d", countActive(deals)), fmt.Sprintf("%d total", len(deals)), "folder") @statCard("PROSPECT", fmt.Sprintf("%d", countByStages(deals, "prospect", "pipeline")), "prospecting", "file") @statCard("INTERNAL", fmt.Sprintf("%d", countByStages(deals, "internal", "")), "internal review", "users") @statCard("INITIAL MARKETING", fmt.Sprintf("%d", countByStages(deals, "initial_marketing", "initial_review")), "marketing", "trend") @statCard("IOI", fmt.Sprintf("%d", countByStages(deals, "ioi", "due_diligence")), "indication of interest", "trend") @statCard("LOI", fmt.Sprintf("%d", countByStages(deals, "loi", "final_negotiation")), "letter of intent", "trend")

Recent Activity

Full log
for _, act := range activities {
@activityIcon(act.ActivityType)

{ act.ActivityType } { act.ResourceName }

{ act.UserName } · { act.CreatedAt.Format("Jan 2, 3:04 PM") } if act.DealName != "" { · { act.DealName } }

}
} } func countActive(deals []*model.Deal) int { count := 0 for _, d := range deals { if d.Stage != "closed" && d.Stage != "dead" { count++ } } return count } func countByStage(deals []*model.Deal, stage string) int { count := 0 for _, d := range deals { if d.Stage == stage { count++ } } return count } func countByStages(deals []*model.Deal, stage1 string, stage2 string) int { count := 0 for _, d := range deals { if d.Stage == stage1 || (stage2 != "" && d.Stage == stage2) { count++ } } return count } func totalFiles(fc map[string]int) int { total := 0 for _, c := range fc { total += c } return total } func formatLastAccessed(t *time.Time) string { if t == nil { return "Never accessed" } return "Last accessed " + t.Format("Jan 2") } templ statCard(label, value, subtitle, iconType string) {
{ label }
if iconType == "folder" { } if iconType == "file" { } if iconType == "users" { } if iconType == "trend" { }
{ value }

{ subtitle }

} templ newRoomForm() {
1
Deal Info
2
Add Users
3
Folders
} templ activityIcon(actType string) {
}