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("mal - 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-(--panel-soft) px-2 py-1 text-xs text-(--text-muted) no-underline hover:bg-(--surface-tab-hover) hover:text-(--text) hover:no-underline" if active { return "shrink-0 whitespace-nowrap bg-(--surface-tab-active) px-2 py-1 text-xs text-(--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) }