aboutsummaryrefslogtreecommitdiff
path: root/web/index.go
blob: ac4cbda7e4cd4411f9fe4bde71c9a51c503609a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package web

import (
	"github.com/a-h/templ"

	"github.com/TecharoHQ/anubis/lib/policy/config"
)

func Base(title string, body templ.Component) templ.Component {
	return base(title, body, nil, nil)
}

func BaseWithChallengeAndOGTags(title string, body templ.Component, challenge string, rules *config.ChallengeRules, ogTags map[string]string) (templ.Component, error) {
	return base(title, body, struct {
		Challenge string                 `json:"challenge"`
		Rules     *config.ChallengeRules `json:"rules"`
	}{
		Challenge: challenge,
		Rules:     rules,
	}, ogTags), nil
}

func Index() templ.Component {
	return index()
}

func ErrorPage(msg string, mail string) templ.Component {
	return errorPage(msg, mail)
}

func Bench() templ.Component {
	return bench()
}