package templates
import (
"malago/internal/jikan"
"fmt"
"net/url"
)
templ Search(q string) {
@Layout("malago - search") {
if q != "" {
} else {
search for anime
use the search bar above to find anime to add to your watchlist
}
}
}
templ SearchResultsWrapper(query string, animes []jikan.Anime, nextPage int, hasNext bool) {
if len(animes) == 0 {
no results found
try a different search term
} else {
@SearchItems(query, animes, nextPage, hasNext)
}
}
templ SearchItems(query string, animes []jikan.Anime, nextPage int, hasNext bool) {
for i, anime := range animes {
if i == len(animes)-1 && hasNext {
@CatalogItem(anime)
} else {
@CatalogItem(anime)
}
}
}