package pages

import (
	"fmt"

	"keikos.work/templates/layouts"

	"forge.capytal.company/capytalcode/project-comicverse/lib/router/rerrors"
)

type ErrorPage struct{}

templ (p ErrorPage) Component(err rerrors.RouteError) {
	@layouts.Page() {
		<main>
			<h1>Error</h1>
			<p>{ fmt.Sprintf("%#v", err) }</p>
			for k, v := range err.Info {
				<p>{ k } { fmt.Sprint(v) } </p>
			}
			if err.Endpoint != "" {
				<a href={ templ.SafeURL(err.Endpoint) }>Retry</a>
			}
		</main>
	}
}
