"use client"; import { motion } from "motion/react"; import Image from "next/image"; import Link from "next/link"; interface TitleCardProps { id?: string; tmdbId: number; type: string; title: string; posterPath: string | null; releaseDate?: string | null; voteAverage?: number | null; href?: string; onImport?: () => void; } export function TitleCard({ id, type, title, posterPath, releaseDate, voteAverage, href, onImport, }: TitleCardProps) { const year = releaseDate?.slice(0, 4); const posterUrl = posterPath ? `https://image.tmdb.org/t/p/w300${posterPath}` : null; const content = ( {posterUrl ? ( ) : ( {title} )} {/* Hover gradient overlay with metadata */} {title} {type} {year && {year}} {voteAverage != null && voteAverage > 0 && ( ★ {voteAverage.toFixed(1)} )} ); if (href || id) { return {content}; } if (onImport) { return ( {content} ); } return content; }
{title}