package templates import "bookhoard/internal/handlers" import "fmt" templ Progress(user User, progressData []handlers.ProgressWithMedia, errorMessage string) { Reading Progress - Bookhoard @Header(user, "/progress")
@Icon("book-open", "h-5 w-5")

Reading Progress

Track your reading progress across all devices

if len(progressData) == 0 {
@Icon("book-open", "h-12 w-12 opacity-50")

No Progress Yet

Start reading a book to track your progress

} for _, item := range progressData {
Cover

{ item.Title }

if item.Author != "" {

by { item.Author }

}
{ fmt.Sprintf("%.2f", item.ProgressPercentage) }%
Current Position

if item.FormatGroup == "reflowable" { if item.EstimatedPages > 0 { { fmt.Sprintf("Page %d of %d (est.)", item.CurrentPage, item.EstimatedPages) } } else { { fmt.Sprintf("%.2f%%", item.ProgressPercentage) } } } else { { fmt.Sprintf("%d / %d", item.CurrentPage, item.TotalPages) } }

Last Updated

{ item.LastUpdated }

Synced From
{ item.DeviceIcon } { item.DeviceName }
if item.DeviceIcon != "" {
@Icon("sync", "h-4 w-4") Last sync from { item.DeviceName } ({ item.DeviceType })
} if item.EpubCFI != "" {
@Icon("bookmark", "h-3.5 w-3.5") CFI: { item.EpubCFI }
}
}
@ErrorToast(errorMessage) }