main / internal/interface/web/templates/errors.templ
750 B · Templ Raw
1package templates
2
3import "gitgud/internal/domain"
4
5templ Forbidden(user *domain.User) {
6 @Layout("Forbidden · gitgud", user) {
7 @errorState("403", "Access denied", "You don't have permission to do that.")
8 }
9}
10
11templ ServerError(user *domain.User) {
12 @Layout("Error · gitgud", user) {
13 @errorState("500", "Something went wrong", "An unexpected error occurred. Please try again.")
14 }
15}
16
17templ errorState(code, title, body string) {
18 <div class="mx-auto max-w-md py-20 text-center">
19 <div class="mb-4 font-mono text-6xl font-bold text-accent/30">{ code }</div>
20 <h1 class="text-2xl font-semibold tracking-tight text-ink">{ title }</h1>
21 <p class="mt-2 text-sm text-muted">{ body }</p>
22 <a class="btn mt-6" href="/">← Back home</a>
23 </div>
24}