snips.sh

  1// Code generated by templ - DO NOT EDIT.
  2
  3// templ: version: v0.3.857
  4package components
  5
  6//lint:file-ignore SA4006 This context is only used if a nested component is present.
  7
  8import "github.com/a-h/templ"
  9import templruntime "github.com/a-h/templ/runtime"
 10
 11func Button(text string) templ.Component {
 12	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 13		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 14		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
 15			return templ_7745c5c3_CtxErr
 16		}
 17		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 18		if !templ_7745c5c3_IsBuffer {
 19			defer func() {
 20				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 21				if templ_7745c5c3_Err == nil {
 22					templ_7745c5c3_Err = templ_7745c5c3_BufErr
 23				}
 24			}()
 25		}
 26		ctx = templ.InitializeContext(ctx)
 27		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
 28		if templ_7745c5c3_Var1 == nil {
 29			templ_7745c5c3_Var1 = templ.NopComponent
 30		}
 31		ctx = templ.ClearChildren(ctx)
 32		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<button class=\"btn btn-xs\">")
 33		if templ_7745c5c3_Err != nil {
 34			return templ_7745c5c3_Err
 35		}
 36		var templ_7745c5c3_Var2 string
 37		templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(text)
 38		if templ_7745c5c3_Err != nil {
 39			return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/example.templ`, Line: 4, Col: 34}
 40		}
 41		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
 42		if templ_7745c5c3_Err != nil {
 43			return templ_7745c5c3_Err
 44		}
 45		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</button> <button class=\"btn btn-sm\">")
 46		if templ_7745c5c3_Err != nil {
 47			return templ_7745c5c3_Err
 48		}
 49		var templ_7745c5c3_Var3 string
 50		templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text)
 51		if templ_7745c5c3_Err != nil {
 52			return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/example.templ`, Line: 5, Col: 34}
 53		}
 54		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
 55		if templ_7745c5c3_Err != nil {
 56			return templ_7745c5c3_Err
 57		}
 58		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</button> <button class=\"btn\">")
 59		if templ_7745c5c3_Err != nil {
 60			return templ_7745c5c3_Err
 61		}
 62		var templ_7745c5c3_Var4 string
 63		templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text)
 64		if templ_7745c5c3_Err != nil {
 65			return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/example.templ`, Line: 6, Col: 27}
 66		}
 67		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
 68		if templ_7745c5c3_Err != nil {
 69			return templ_7745c5c3_Err
 70		}
 71		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</button> <button class=\"btn btn-lg\">")
 72		if templ_7745c5c3_Err != nil {
 73			return templ_7745c5c3_Err
 74		}
 75		var templ_7745c5c3_Var5 string
 76		templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text)
 77		if templ_7745c5c3_Err != nil {
 78			return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/example.templ`, Line: 7, Col: 34}
 79		}
 80		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
 81		if templ_7745c5c3_Err != nil {
 82			return templ_7745c5c3_Err
 83		}
 84		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</button> <button class=\"btn btn-xl\">")
 85		if templ_7745c5c3_Err != nil {
 86			return templ_7745c5c3_Err
 87		}
 88		var templ_7745c5c3_Var6 string
 89		templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(text)
 90		if templ_7745c5c3_Err != nil {
 91			return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/example.templ`, Line: 8, Col: 34}
 92		}
 93		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
 94		if templ_7745c5c3_Err != nil {
 95			return templ_7745c5c3_Err
 96		}
 97		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</button>")
 98		if templ_7745c5c3_Err != nil {
 99			return templ_7745c5c3_Err
100		}
101		return nil
102	})
103}
104
105func Main() templ.Component {
106	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
107		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
108		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
109			return templ_7745c5c3_CtxErr
110		}
111		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
112		if !templ_7745c5c3_IsBuffer {
113			defer func() {
114				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
115				if templ_7745c5c3_Err == nil {
116					templ_7745c5c3_Err = templ_7745c5c3_BufErr
117				}
118			}()
119		}
120		ctx = templ.InitializeContext(ctx)
121		templ_7745c5c3_Var7 := templ.GetChildren(ctx)
122		if templ_7745c5c3_Var7 == nil {
123			templ_7745c5c3_Var7 = templ.NopComponent
124		}
125		ctx = templ.ClearChildren(ctx)
126		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<!doctype html><html><head><title>a title</title><link rel=\"stylesheet\" href=\"/style.css\"></head><body>")
127		if templ_7745c5c3_Err != nil {
128			return templ_7745c5c3_Err
129		}
130		templ_7745c5c3_Err = Button("meep").Render(ctx, templ_7745c5c3_Buffer)
131		if templ_7745c5c3_Err != nil {
132			return templ_7745c5c3_Err
133		}
134		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</body></html>")
135		if templ_7745c5c3_Err != nil {
136			return templ_7745c5c3_Err
137		}
138		return nil
139	})
140}
141
142var _ = templruntime.GeneratedTemplate