package templates import ( "fmt" "mal/internal/jikan" "net/url" ) templ Search(q string) { @Layout("mal - search") { if q != "" {
Searching...
} 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) { @InfiniteAnimeList(animes, hasNext, string(templ.URL(fmt.Sprintf("/api/search?q=%s&page=%d", url.QueryEscape(query), nextPage))), "results") }