package components import "arabica/internal/models" // DialogModalProps defines properties for a native HTML5 dialog modal type DialogModalProps struct { ID string // Dialog ID (e.g., "bean-modal") Title string } // BeanDialogModal renders the bean creation/edit modal using native templ BeanDialogModal(bean *models.Bean, roasters []models.Roaster) { } // GrinderDialogModal renders the grinder creation/edit modal using native templ GrinderDialogModal(grinder *models.Grinder) { } // BrewerDialogModal renders the brewer creation/edit modal using native templ BrewerDialogModal(brewer *models.Brewer) { } // RoasterDialogModal renders the roaster creation/edit modal using native templ RoasterDialogModal(roaster *models.Roaster) { } // ReportDialogModalProps defines properties for the report dialog type ReportDialogModalProps struct { SubjectURI string SubjectCID string } // ReportDialogModal renders the report modal for submitting content reports templ ReportDialogModal(props ReportDialogModalProps) { } // Helper function to get string value from bean (handles nil case) func getStringValue(entity interface{}, field string) string { if entity == nil { return "" } switch e := entity.(type) { case *models.Bean: if e == nil { return "" } switch field { case "name": return e.Name case "origin": return e.Origin case "variety": return e.Variety case "process": return e.Process case "description": return e.Description } case *models.Grinder: if e == nil { return "" } switch field { case "name": return e.Name case "notes": return e.Notes } case *models.Brewer: if e == nil { return "" } switch field { case "name": return e.Name case "brewer_type": return e.BrewerType case "description": return e.Description } case *models.Roaster: if e == nil { return "" } switch field { case "name": return e.Name case "location": return e.Location case "website": return e.Website } } return "" }