package addview import "github.com/tigorlazuardi/redmage/views" import "github.com/tigorlazuardi/redmage/views/components" import "github.com/tigorlazuardi/redmage/views/utils" templ Addview(c *views.Context) { @components.Doctype() { @components.Head(c, components.HeadTitle("Redmage - Subreddits")) @components.Body(c) { @AddviewContent(c) @components.NotificationContainer() } } } templ AddviewContent(c *views.Context) {
@components.Container() {

Add Subreddit

}
} type SubredditInputData struct { Value string Error string Valid bool } templ SubredditInputForm(data SubredditInputData) {
Subreddit Name
@subredditInputField("/htmx/subreddits/check", data)
if data.Valid { Subreddit / User target is valid } else { { data.Error } }
} templ subredditInputField(target string, data SubredditInputData) { }