From ad9df203163e6f2d342b88ac6e7930419a655949 Mon Sep 17 00:00:00 2001 From: Hayden Hargreaves Date: Tue, 1 Jul 2025 20:02:45 -0700 Subject: [PATCH] (FIX): Using components in the create form. Going to move on from this for now. We need a page to view a recipe! **C**reate is done, now we need **R**ead, **U**pdate and **D**elete. --- internal/templates/pages/recipe.templ | 7 +++++ internal/templates/pages/recipe_templ.go | 40 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 internal/templates/pages/recipe.templ create mode 100644 internal/templates/pages/recipe_templ.go diff --git a/internal/templates/pages/recipe.templ b/internal/templates/pages/recipe.templ new file mode 100644 index 0000000..1a905a9 --- /dev/null +++ b/internal/templates/pages/recipe.templ @@ -0,0 +1,7 @@ +package templates + +templ RecipePage() { +

+ Viewing page +

+} diff --git a/internal/templates/pages/recipe_templ.go b/internal/templates/pages/recipe_templ.go new file mode 100644 index 0000000..2cd953c --- /dev/null +++ b/internal/templates/pages/recipe_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +package templates + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func RecipePage() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

Viewing page

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate