package templates import ( "fmt" "bookhoard/internal/services" ) // UnlinkedMatchCards renders the match candidates for one device file's // "find matches" reveal — the /unlinked-books/matches partial response. // Cards are clicked through the delegated data-action handler (rendering // ownership: templ renders, JS only swaps and handles the click). templ UnlinkedMatchCards(progressId string, matches []services.BookMatch) { if len(matches) == 0 {

No matches found. Try manual linking.

} else { for _, match := range matches {
Cover
{ match.Title }
if match.Author != "" {

by { match.Author }

}
{ fmt.Sprintf("%.0f%% confidence", match.Confidence*100) } { match.MatchMethod }
} } } templ UnlinkedBooks(user User, unlinkedBooks []UnlinkedBookData) { Unlinked Books - Bookhoard @Header(user, "/unlinked")
@Icon("sync", "h-5 w-5")

Unlinked Books

Resolve books that couldn't be automatically matched between devices

if len(unlinkedBooks) > 0 {
0 selected
}
if len(unlinkedBooks) == 0 {
@Icon("check-circle", "h-7 w-7")

All Books Linked!

There are no unlinked books that need manual resolution.

} for _, book := range unlinkedBooks {
if book.DeviceType == "koreader" { @Icon("book-open", "h-5 w-5") } else if book.DeviceType == "kobo" { @Icon("library", "h-5 w-5") } else { @Icon("device", "h-5 w-5") }

{ book.TitleFromDevice }

Device: { book.DeviceName } ({ book.DeviceType })

File Path: @Icon("folder", "h-3.5 w-3.5") { book.FilePath }
if book.SHA256 != "" {
SHA-256: { book.SHA256 }
}
Last Synced: { book.LastSyncTime }
if book.ConfidenceScore > 0 {
Auto-Link Confidence: { book.ConfidenceScore }% confidence
}
}
}