package templates import "dealroom/internal/model" import "fmt" import "strings" templ ContactsPage(profile *model.Profile, contacts []*model.Contact, deals []*model.Deal, selectedDealID string) { @Layout(profile, "contacts") {

Contacts

{ fmt.Sprintf("%d contacts", len(contacts)) } across all deal rooms.

for _, contact := range contacts { }
Name Company Email Type Deals Tags
{ contactInitials(contact.FullName) }
{ contact.FullName }

{ contact.Title }

{ contact.Company } { contact.Email } @ContactTypeBadge(contact.ContactType)
for _, dn := range contact.DealNames { { dn } }
for _, tag := range splitTags(contact.Tags) { if tag != "" { { tag } } }
} } func contactInitials(name string) string { parts := strings.Fields(name) if len(parts) >= 2 { return string(parts[0][0]) + string(parts[len(parts)-1][0]) } if len(name) > 0 { return string(name[0]) } return "?" } func splitTags(tags string) []string { return strings.Split(tags, ",") }