@errorIcon()
Error
@closeButton()
}
// 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.
//
// If this is called from an NON-HTMX request, it will display (and functionality seems to work)
// but it will be loaded at an unknown position in the DOM. It will not swap with the proper
// element.
func RenderErrorBanner(ctx *gin.Context, message string) {
ctx.Writer.Header().Set("Content-Type", "text/html")
errorBanner(message).Render(ctx.Request.Context(), ctx.Writer)
}