package routes import ( "fmt" "github.com/LazyBachelor/LazyPM/internal/models" "github.com/LazyBachelor/LazyPM/pkg/web/components" ) type IssueDetailProps struct { Issue models.Issue Comments []*models.Comment } templ IssueDetailContent(props IssueDetailProps) {
@components.IconBack() Back to Issues
{ props.Issue.ID }

{ 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") }

if props.Issue.Assignee != "" {
Assignee

{ props.Issue.Assignee }

} if props.Issue.Owner != "" {
Owner

{ props.Issue.Owner }

}
@components.CommentSection(components.CommentSectionProps{ IssueID: props.Issue.ID, Comments: props.Comments, })
} templ IssueDetail(props IssueDetailProps) { @BaseLayout() { @IssueDetailContent(props) } } 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: P0 - Critical case 1: P1 - High case 2: P2 - Medium case 3: P3 - Low case 4: P4 - Minimal default: { fmt.Sprintf("P%d", priority) } } }