about summary refs log tree commit diff stats
path: root/internal/components/dev.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/components/dev.go')
-rw-r--r--internal/components/dev.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/components/dev.go b/internal/components/dev.go
new file mode 100644
index 0000000..3d77094
--- /dev/null
+++ b/internal/components/dev.go
@@ -0,0 +1,23 @@
+package components
+
+import (
+	"strconv"
+
+	"go.alanpearce.eu/searchix/internal/index"
+
+	g "go.alanpearce.eu/gomponents"
+	. "go.alanpearce.eu/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())),
+		),
+	})
+}