package templates import "github.com/haydenhargreaves/Potion/internal/templates/components" import "github.com/haydenhargreaves/Potion/internal/domain/server" import domainRecipe "github.com/haydenhargreaves/Potion/internal/domain/recipe" templ introSection() {

Discover Your Next Favorite Meal

Welcome to your ultimate recipe hub! Whether you're a seasoned chef or just starting your culinary adventure, we're here to inspire. Explore thousands of delicious recipes, from quick weeknight dinners to gourmet delights, all at your fingertips. Find exactly what you're craving with our powerful search and intuitive filters, or browse our trending dishes for fresh ideas.

} templ searchSection() {
@components.BannerText("Craving Something Specific?")
@components.SearchBar(domainRecipe.SearchFilters{}, true, false, false)
} templ highlightSection(liked bool) {
@components.BannerText("Recipe of the Week!")

Our 'Recipe of the Week' is the cream of the crop! We handpick it by looking at what recipes our community loves most. This isn't just about how many people view a recipe; it's also about how many times it's been made, liked, reviewed, and its average rating, all combined to find the true fan favorite of the week. It's our way of highlighting the best recipes that truly resonate with our users!

@components.RecipeCardLarge(nil)
} templ listsSection(loggedIn bool, viewed, made []domainRecipe.Recipe) {
@components.BannerText("Take Another Look.")

Recently viewed

if loggedIn {
if len(viewed) > 0 { for _, recipe := range viewed { @components.RecipeCardSmall(recipe) } @components.ContentCardSmall("View full history...", "/v1/web/history") } else {

You have not viewed any recipes. There is nothing to show.

}
} else { }

Make again

if loggedIn {
if len(made) > 0 { for _, recipe := range made { @components.RecipeCardSmall(recipe) } @components.ContentCardSmall("View full history...", "/v1/web/history") } else {

You have not made any recipes. There is nothing to show.

}
} else { }
} templ ctaSection() {

Unleash Your Inner Chef!

Have a unique recipe idea? Want to share your culinary masterpiece with the world? It's time to bring your creations to life!

Create Your Recipe!
} templ HomePage(loggedIn bool, viewed, made []domainRecipe.Recipe) { @components.Navbar("home")
@introSection() @searchSection() @highlightSection(false) @listsSection(loggedIn, viewed, made) @ctaSection()
}