all repos — searchix @ 896d844cac976afd0ee8aa73dd2fb28e15e7ac79

Search engine for NixOS, nix-darwin, home-manager and NUR users

internal/components/error.go (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package components

import (
	g "go.alanpearce.eu/gomponents"
	. "go.alanpearce.eu/gomponents/html"
)

func Error(tdata TemplateData) g.Node {
	return P(
		Class("notice error"),
		g.Textf("%d %s", tdata.Code, tdata.Message),
	)
}

func ErrorPage(tdata TemplateData) g.Node {
	return Page(tdata, Error(tdata))
}