Darius klein 5e1cd15c07
All checks were successful
build and deploy portfolio / build (pull_request) Successful in 51s
build and deploy portfolio / publish-docs (pull_request) Successful in 4s
build and deploy portfolio / publish-portfolio (pull_request) Successful in 3s
Version bump + migration dependencies
2025-05-07 22:33:21 +02:00

43 lines
983 B
Go

package components
import (
"github.com/delaneyj/gomponents-iconify/iconify/mdi"
b "github.com/willoma/bulma-gomponents"
e "github.com/willoma/gomplements"
g "maragu.dev/gomponents"
)
func Email(valid bool, invalid bool, color e.Element) e.Element {
return b.Field(
b.Label("Email"),
b.Control(
b.IconsLeft,
b.InputEmail(
e.Name("email"),
color,
e.Placeholder("Email input"),
),
b.Icon(mdi.Email(), b.Left),
),
g.If(invalid, b.Help(b.Danger, "This email is invalid")),
g.If(valid, b.Help(b.Success, "This email is valid")),
)
}
func Password(valid bool, invalid bool, color e.Element) e.Element {
return b.Field(
b.Label("Email"),
b.Control(
b.IconsLeft,
b.InputPassword(
e.Name("password"),
color,
e.Placeholder("password input"),
),
b.Icon(mdi.FormTextboxPassword(), b.Left),
),
g.If(invalid, b.Help(b.Danger, "This password is invalid")),
g.If(valid, b.Help(b.Success, "This password is valid")),
)
}