htmgo/examples/chat/components/error.go

15 lines
248 B
Go
Raw Normal View History

2024-10-01 01:32:42 +00:00
package components
import "github.com/maddalax/htmgo/framework/h"
func FormError(error string) *h.Element {
return h.Div(
h.Id("form-error"),
h.Text(error),
h.If(
error != "",
h.Class("p-4 bg-rose-400 text-white rounded"),
),
2024-10-01 01:32:42 +00:00
)
}