Refactor: Eliminate duplicate types - Use handler types directly

- Deleted templates.CollectionDetailData - using templates.CollectionData everywhere
- Deleted templates.BookData - using handlers.BookInfo everywhere
- Deleted templates.DeviceData - using handlers.DeviceInfo everywhere
- Deleted templates.ProgressItemData - using handlers.ProgressWithMedia everywhere
- Deleted templates.convertDevices() helper - Use handlers types directly in templates
- Enhanced handlers.ProgressWithMedia with device metadata fields
- Added handlers.getDeviceIcon() helper
- Updated all templates to import handlers package
- Cleaned up unused imports

This aligns codebase with templ's design philosophy (use Go types directly, no parallel type system)
This commit is contained in:
2026-02-12 19:48:07 -05:00
parent b5745e1554
commit 2a64ca423f
15 changed files with 639 additions and 168 deletions
+3 -1
View File
@@ -1,5 +1,7 @@
package templates
import "bookhoard/internal/handlers"
templ Collection(user User, collections []CollectionData) {
<!DOCTYPE html>
<html lang="en">
@@ -210,7 +212,7 @@ templ Collection(user User, collections []CollectionData) {
</html>
}
templ CollectionDetail(user User, collection CollectionDetailData, books []BookData) {
templ CollectionDetail(user User, collection CollectionData, books []handlers.BookInfo) {
<!DOCTYPE html>
<html lang="en">
<head>