package components import "github.com/gin-gonic/gin" templ errorIcon() { } templ closeButton() { } templ errorBanner(message string) {
@errorIcon()

Error

@closeButton()

{ message }

} // RenderErrorBanner renders the error banner. However, this function must ONLY be called by an // HTMX route. Otherwise, there is no promise it will work (may result in undefined behavior). // Just writes a piece of content to the response. func RenderErrorBanner(ctx *gin.Context, message string) { ctx.Writer.Header().Set("Content-Type", "text/html") errorBanner(message).Render(ctx.Request.Context(), ctx.Writer) }