0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-12-19 10:51:52 +01:00
gitea/components/search_button.go
2025-05-27 20:25:07 -07:00

33 lines
544 B
Go

package components
import (
g "maragu.dev/gomponents"
gh "maragu.dev/gomponents/html"
)
func SearchButton(disabled bool, tooltip string) g.Node {
// Corresponds to templates/shared/search/button.tmpl
class := "ui icon button"
if disabled {
class += " disabled"
}
btn := gh.Button(
gh.Type("submit"),
gh.Class(class),
SVG("octicon-search", 16),
)
if tooltip != "" {
btn = gh.Button(
gh.Type("submit"),
gh.Class(class),
g.Attr("data-tooltip-content", tooltip),
SVG("octicon-search", 16),
)
}
return btn
}