package subredditsview import "github.com/tigorlazuardi/redmage/views" import "github.com/tigorlazuardi/redmage/views/components" templ Subreddit(c *views.Context, data Data) { @components.Doctype() { @components.Head(c, components.HeadTitle("Redmage - Subreddits")) @components.Body(c) { @SubredditContent(c, data) } } } templ SubredditContent(c *views.Context, data Data) {
@components.Container() {

Subreddits

if len(data.Subreddits) == 0 {

You have not added any subreddits yet.

Click here to add a new subreddit.

} for _, subreddit := range data.Subreddits {

{ subreddit.Name }

} }
}