package components import ( "fmt" "github.com/LazyBachelor/LazyPM/internal/models" ) type IssueDetailProps struct { Issue *models.Issue } templ IssueDetail(props IssueDetailProps) {

{ props.Issue.Title }

@StatusBadge(props.Issue.Status) @TypeBadge(props.Issue.IssueType) @PriorityBadge(props.Issue.Priority)
if props.Issue.Description != "" {

Description

{ props.Issue.Description }

}
Created

{ props.Issue.CreatedAt.Format("Jan 2, 2006") }

Updated

{ props.Issue.UpdatedAt.Format("Jan 2, 2006") }

Created by

{ props.Issue.CreatedBy }

if props.Issue.Assignee == "" { Unassigned (click to assign) } else { Assignee: { props.Issue.Assignee } }
} templ StatusBadge(status models.Status) { switch status { case "open": Open case "in_progress": In Progress case "closed": Closed case "blocked": Blocked case "deferred": Deferred default: { string(status) } } } templ TypeBadge(issueType models.IssueType) { switch issueType { case "bug": Bug case "feature": Feature case "task": Task case "chore": Chore case "epic": Epic default: { string(issueType) } } } templ PriorityBadge(priority int) { switch priority { case 0: Critical case 1: High case 2: Medium case 3: Low case 4: Minimal default: { fmt.Sprintf("P%d", priority) } } }