ikurotime / gitgud

public
main / internal/interface/web/templates/profile_templ.go
4.7 KB · Go Raw
  1// Code generated by templ - DO NOT EDIT.
  2
  3// templ: version: v0.3.865
  4package templates
  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
 11import "gitgud/internal/domain"
 12
 13func Profile(user *domain.User, owner string, repos []*domain.Repository) templ.Component {
 14	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 15		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 16		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
 17			return templ_7745c5c3_CtxErr
 18		}
 19		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 20		if !templ_7745c5c3_IsBuffer {
 21			defer func() {
 22				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 23				if templ_7745c5c3_Err == nil {
 24					templ_7745c5c3_Err = templ_7745c5c3_BufErr
 25				}
 26			}()
 27		}
 28		ctx = templ.InitializeContext(ctx)
 29		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
 30		if templ_7745c5c3_Var1 == nil {
 31			templ_7745c5c3_Var1 = templ.NopComponent
 32		}
 33		ctx = templ.ClearChildren(ctx)
 34		templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 35			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 36			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 37			if !templ_7745c5c3_IsBuffer {
 38				defer func() {
 39					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 40					if templ_7745c5c3_Err == nil {
 41						templ_7745c5c3_Err = templ_7745c5c3_BufErr
 42					}
 43				}()
 44			}
 45			ctx = templ.InitializeContext(ctx)
 46			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"mb-6 flex items-center gap-4\"><div class=\"flex size-14 items-center justify-center rounded-full bg-gradient-to-br from-[#2a2a2a] to-[#0e0e0e] font-mono text-xl font-bold text-ink ring-1 ring-line2\">")
 47			if templ_7745c5c3_Err != nil {
 48				return templ_7745c5c3_Err
 49			}
 50			var templ_7745c5c3_Var3 string
 51			templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(initial(owner))
 52			if templ_7745c5c3_Err != nil {
 53				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/interface/web/templates/profile.templ`, Line: 9, Col: 20}
 54			}
 55			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
 56			if templ_7745c5c3_Err != nil {
 57				return templ_7745c5c3_Err
 58			}
 59			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div><div><h1 class=\"text-xl font-semibold tracking-tight\">")
 60			if templ_7745c5c3_Err != nil {
 61				return templ_7745c5c3_Err
 62			}
 63			var templ_7745c5c3_Var4 string
 64			templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(owner)
 65			if templ_7745c5c3_Err != nil {
 66				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/interface/web/templates/profile.templ`, Line: 12, Col: 60}
 67			}
 68			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
 69			if templ_7745c5c3_Err != nil {
 70				return templ_7745c5c3_Err
 71			}
 72			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</h1><p class=\"meta mt-0.5\">")
 73			if templ_7745c5c3_Err != nil {
 74				return templ_7745c5c3_Err
 75			}
 76			var templ_7745c5c3_Var5 string
 77			templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(repos)))
 78			if templ_7745c5c3_Err != nil {
 79				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/interface/web/templates/profile.templ`, Line: 13, Col: 45}
 80			}
 81			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
 82			if templ_7745c5c3_Err != nil {
 83				return templ_7745c5c3_Err
 84			}
 85			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " repositories</p></div></div>")
 86			if templ_7745c5c3_Err != nil {
 87				return templ_7745c5c3_Err
 88			}
 89			if len(repos) == 0 {
 90				templ_7745c5c3_Err = emptyState("Nothing here yet", "This user has no repositories to show.", "", "").Render(ctx, templ_7745c5c3_Buffer)
 91				if templ_7745c5c3_Err != nil {
 92					return templ_7745c5c3_Err
 93				}
 94			} else {
 95				templ_7745c5c3_Err = repoList(repos).Render(ctx, templ_7745c5c3_Buffer)
 96				if templ_7745c5c3_Err != nil {
 97					return templ_7745c5c3_Err
 98				}
 99			}
100			return nil
101		})
102		templ_7745c5c3_Err = Layout(owner+" · gitgud", user).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
103		if templ_7745c5c3_Err != nil {
104			return templ_7745c5c3_Err
105		}
106		return nil
107	})
108}
109
110var _ = templruntime.GeneratedTemplate