package templates import "gitgud/internal/domain" templ Explore(user *domain.User, repos []*domain.Repository) { @Layout("Explore · gitgud", user) {

Public repositories

{ itoa(len(repos)) } public { plural(len(repos), "repository", "repositories") } on this instance.

if user != nil { + New repository }
if len(repos) == 0 { if user != nil { @emptyState("No public repositories yet", "Create a public repository and it will show up here for everyone.", "/new", "Create repository") } else { @emptyState("No public repositories yet", "When someone creates a public repository, it will appear here.", "", "") } } else { @repoList(repos) }
} } templ repoList(repos []*domain.Repository) {
for _, repo := range repos {
{ repo.OwnerName }/{ repo.Name } if repo.IsPrivate { private } else { public }
if repo.Description != "" {

{ repo.Description }

}
{ repo.DefaultBranch }
}
} templ emptyState(title, body, href, cta string) {
·

{ title }

{ body }

if href != "" { { cta } }
}