package main // diagramCaptionComponent renders the figure with overlay pins and a Fig. heading. templ diagramCaptionComponent(data DiagramCaptionData) {
if data.Image == "" {
No diagram yet
} else { { for _, pin := range data.CalloutPins { { pin.Label } } }

{ "Fig. " } if data.FigureNumber != "" { { data.FigureNumber } } else { { "00" } } { "." } if data.Title != "" { { data.Title } }

if data.Body != "" {
@templ.Raw(data.Body)
}
}