diff --git a/internal/shared/ui/anime_card.templ b/internal/shared/ui/anime_card.templ
new file mode 100644
index 0000000..258bb78
--- /dev/null
+++ b/internal/shared/ui/anime_card.templ
@@ -0,0 +1,22 @@
+package ui
+
+import "fmt"
+
+type AnimeCardProps struct {
+ ID int
+ Title string
+ ImageURL string
+}
+
+templ AnimeCard(props AnimeCardProps) {
+
+ if props.ImageURL != "" {
+
+ } else {
+ No image
+ }
+
+
+ { props.Title }
+
+}
diff --git a/internal/shared/ui/anime_list.templ b/internal/shared/ui/anime_list.templ
index fbdeb9c..76888c6 100644
--- a/internal/shared/ui/anime_list.templ
+++ b/internal/shared/ui/anime_list.templ
@@ -36,14 +36,9 @@ templ InfiniteAnimeList(animes []jikan.Anime, hasNext bool, nextURL string, cont
}
templ CatalogItem(anime jikan.Anime) {
-
- if anime.ImageURL() != "" {
-
- } else {
- No image
- }
-
-
- { anime.DisplayTitle() }
-
+ @AnimeCard(AnimeCardProps{
+ ID: anime.MalID,
+ Title: anime.DisplayTitle(),
+ ImageURL: anime.ImageURL(),
+ })
}
diff --git a/internal/templates/watchlist.templ b/internal/templates/watchlist.templ
index eb36fc3..9a788aa 100644
--- a/internal/templates/watchlist.templ
+++ b/internal/templates/watchlist.templ
@@ -47,14 +47,11 @@ templ Watchlist(entries []database.GetUserWatchListRow, layout string, currentSt
for _, entry := range entries {