internal/components/dev.go (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | package components
import (
"strconv"
"alin.ovh/searchix/internal/index"
g "alin.ovh/gomponents"
. "alin.ovh/gomponents/html"
)
func Score(h index.DocumentMatch) g.Node {
return g.Group([]g.Node{
A(
Class("open-sibling-dialog"),
g.Text(strconv.FormatFloat(h.Score, 'f', 2, 64)),
),
Dialog(
Button(AutoFocus(), g.Text("Close")),
Pre(g.Text(h.Expl.String())),
),
})
}
|