From a1dfc548198a1326e71f1dd70303a5d3441f7a39 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 21 Jun 2024 13:02:08 +0200 Subject: refactor: switch to templ for HTML templates --- internal/components/error.templ | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 internal/components/error.templ (limited to 'internal/components/error.templ') diff --git a/internal/components/error.templ b/internal/components/error.templ new file mode 100644 index 0000000..8e45095 --- /dev/null +++ b/internal/components/error.templ @@ -0,0 +1,18 @@ +package components + +import ( + "strconv" +) + +templ Error(tdata TemplateData) { +
+ { strconv.Itoa(tdata.Code) } + { tdata.Message } +
+} + +templ ErrorPage(tdata TemplateData) { + @Page(tdata) { + @Error(tdata) + } +} -- cgit 1.4.1