package templates import ( "fmt" "mal/internal/database" "mal/internal/shared/ui" ) templ Watchlist(entries []database.GetUserWatchListRow, layout string, currentStatus string, sortBy string, sortOrder string) { @Layout("My Watchlist", true) {

Watchlist

Track what you're watching with less noise.

Export
All Watching Continuing On hold Plan to watch Dropped Completed
@ui.SortFilter(ui.SortFilterOptions{Sort: sortBy, Order: sortOrder, View: layout, Status: currentStatus}) if len(entries) == 0 { @ui.EmptyState("Nothing here yet") { if currentStatus == "all" { Your watchlist is empty. Search for anime to get started. } else if currentStatus == "continuing" { No airing anime with watching or plan to watch status. } else { No anime in this category. } } } else { if layout == "grid" {
for _, entry := range entries {
@ui.AnimeCard(ui.AnimeCardProps{ ID: int(entry.AnimeID), Title: entry.DisplayTitle(), ImageURL: entry.ImageUrl, })
}
} else { for _, entry := range entries { }
Title
{ { entry.DisplayTitle() }
} } } } func tabClass(active bool) string { base := "shrink-0 whitespace-nowrap bg-[var(--panel-soft)] px-[0.45rem] py-[0.24rem] text-[0.76rem] text-[var(--text-muted)] no-underline hover:bg-[var(--surface-tab-hover)] hover:text-[var(--text)] hover:no-underline" if active { return "shrink-0 whitespace-nowrap bg-[var(--surface-tab-active)] px-[0.45rem] py-[0.24rem] text-[0.76rem] text-[var(--accent)] no-underline hover:no-underline" } return base } func watchlistURL(view string, status string, sortBy string, sortOrder string) string { return fmt.Sprintf("/watchlist?view=%s&status=%s&sort=%s&order=%s", view, status, sortBy, sortOrder) }