import { Media } from '@/types'; import { cn } from '@/lib/utils'; import { motion } from 'motion/react'; import { Star, Play, Bookmark } from 'lucide-react'; import { Button } from '@/components/ui/button'; interface MediaListItemProps { key?: string; media: Media; onClick: (media: Media) => void; } export default function MediaListItem({ media, onClick }: MediaListItemProps) { const statusColors = { watching: 'bg-blue-500', completed: 'bg-green-500', planned: 'bg-gray-500', dropped: 'bg-red-500', reading: 'bg-amber-500', listening: 'bg-purple-500', playing: 'bg-indigo-500', 'on-hold': 'bg-orange-500', }; const getAspectRatio = () => { if (media.aspectRatio) return media.aspectRatio; switch (media.category) { case 'Music': return '1/1'; case 'Games': case 'Adult': return '16/9'; default: return '2/3'; } }; const aspectRatioClass = { '2/3': 'w-24 h-32', '16/9': 'w-48 h-27', // 16:9 ratio for w-48 is approx h-27 '1/1': 'w-24 h-24', }[getAspectRatio()]; return ( onClick(media)} >
{media.title} {media.status && (
)}

{media.title}

({media.year})
{media.rating || 'N/A'}
{media.genres?.slice(0, 3).join(' • ') || 'Anime'}

{media.description || "No description available for this title."}

); }