package templates import ( "bookhoard/internal/handlers" "fmt" ) templ Dashboard(user User, sections []handlers.SectionData, allSections []handlers.SectionData, libData []LibraryData, currentLibraryID string, hiddenCollections []string, itemsPerSection int, errorMessage string) { Dashboard - Bookhoard @Header(user, "/dashboard") @LibrarySwitcher(libData, currentLibraryID, DashboardActions())
if len(sections) == 0 {
@Icon("book-open", "h-7 w-7")

Your library is empty

Once books are added to your libraries, collections will appear here.

} else {
for _, section := range sections { @CollectionCarousel(section) }
}
@DashboardSettingsModal(allSections, hiddenCollections, itemsPerSection) @ErrorToast(errorMessage) } templ CollectionCarousel(section handlers.SectionData) {

if section.Icon != "" { { section.Icon } } { section.Title }

if section.Description != "" {

{ section.Description }

}
if section.ViewAllURL != "" { View All @Icon("arrow-right", "h-4 w-4") }
} // BookCard is the single, canonical cover-forward card used across the // dashboard, bookshelf, series and collections. The metadata block sits on a // real surface so cards always read as cohesive objects (previously the text // floated with no background when wood-paneling was off). templ BookCard(item handlers.BookInfo) {
if item.CoverImagePath != "" { { } else { { }

{ item.Title }

if item.Author != "" {

{ item.Author }

}
} templ DashboardSettingsModal(sections []handlers.SectionData, hiddenCollections []string, itemsPerSection int) { }