diff --git a/app/(pages)/explore/filterable-title-row.tsx b/app/(pages)/explore/filterable-title-row.tsx index 18e9f48..7a75c78 100644 --- a/app/(pages)/explore/filterable-title-row.tsx +++ b/app/(pages)/explore/filterable-title-row.tsx @@ -5,7 +5,7 @@ import { createStore, Provider, useAtom, useAtomValue } from "jotai"; import { motion } from "motion/react"; import { useState } from "react"; import { TitleCardSkeleton } from "@/components/skeletons"; -import { TitleCard } from "@/components/title-card"; +import { ExploreTitleCard } from "@/components/title-card"; import { Carousel, CarouselContent, @@ -200,7 +200,7 @@ function FilterableTitleRowInner({ className="basis-auto pl-4 w-[140px] shrink-0 sm:w-[160px]" > - - void; - showQuickAdd?: boolean; + userStatus?: TitleStatus | null; + episodeProgress?: { watched: number; total: number } | null; +} + +interface TitleCardProps extends CardInnerProps { + id: string; + tmdbId: number; +} + +interface ExploreTitleCardProps extends CardInnerProps { + tmdbId: number; + href: string; userStatus?: TitleStatus | null; episodeProgress?: { watched: number; total: number } | null; } @@ -129,20 +136,6 @@ function QuickAddButton({ ); } -function StatusBadge({ status }: { status: TitleStatus }) { - const config = statusConfig[status]; - const StatusIcon = config.icon; - - return ( -
- - {config.label} -
- ); -} - function ProgressBar({ watched, total }: { watched: number; total: number }) { const pct = total > 0 ? (watched / total) * 100 : 0; return ( @@ -163,26 +156,25 @@ function ProgressBar({ watched, total }: { watched: number; total: number }) { ); } -export function TitleCard({ - id, - tmdbId, - type, +function CardInner({ title, + type, posterPath, releaseDate, voteAverage, - href, - onImport, - showQuickAdd, userStatus, episodeProgress, -}: TitleCardProps) { +}: CardInnerProps) { const year = releaseDate?.slice(0, 4); const TypeIcon = type === "movie" ? IconMovie : IconDeviceTv; - const cardInner = ( + const ringClass = userStatus + ? "ring-primary/25 shadow-sm shadow-primary/5" + : "ring-white/[0.06]"; + + return ( @@ -211,15 +203,33 @@ export function TitleCard({ )} - {/* Status badge on poster */} - {userStatus && } - {/* Hover gradient overlay */}
- {/* Metadata */}
-

{title}

+
+ {userStatus && ( + + } + > + + + + + + {statusConfig[userStatus].label} + + )} +

+ {title} +

+
{year && {year}} @@ -232,7 +242,6 @@ export function TitleCard({
- {/* Episode progress bar */} {episodeProgress && episodeProgress.watched > 0 && ( ); +} - if (href || id) { - return ( -
- {showQuickAdd && ( - - )} - {cardInner} -
- ); - } +/** Linked title card for library grids, recommendations, dashboards */ +export function TitleCard({ + id, + tmdbId, + type, + title, + posterPath, + releaseDate, + voteAverage, + userStatus, + episodeProgress, +}: TitleCardProps) { + return ( + + + + ); +} - if (onImport) { - return ( - - ); - } - - return cardInner; +/** Explore/browse card with quick-add button and custom href */ +export function ExploreTitleCard({ + tmdbId, + type, + title, + posterPath, + releaseDate, + voteAverage, + href, + userStatus, + episodeProgress, +}: ExploreTitleCardProps) { + return ( +
+ + + + +
+ ); }