package templates import ( "fmt" "net/url" ) templ Series(user User, seriesList []SeriesCardData, libData []LibraryData, currentLibraryID string, totalPages int, currentPage int, errorMessage string) { Series - Bookhoard @Header(user, "/series") @LibrarySwitcher(libData, currentLibraryID)
@Icon("layers", "h-5 w-5")

Series

Grouped by series metadata

if len(seriesList) == 0 {
@Icon("layers", "h-7 w-7")

No Series Found

Books with series metadata will appear here

}
for _, series := range seriesList { @SeriesCard(series) }
if totalPages > 1 {
if currentPage > 1 { @Icon("chevron-left", "h-4 w-4") Previous } Page { fmt.Sprintf("%d", currentPage) } of { fmt.Sprintf("%d", totalPages) } if currentPage < totalPages { Next @Icon("chevron-right", "h-4 w-4") }
}
@ErrorToast(errorMessage) } templ SeriesCard(series SeriesCardData) {
for i, cover := range series.CoverPaths { { } if len(series.CoverPaths) == 0 {
@Icon("book", "h-8 w-8 opacity-60")
}

{ series.Name }

{ fmt.Sprintf("%d", series.BookCount) } of { fmt.Sprintf("%d", series.TotalInSeries) } books

}