import { useState } from 'react'; import { Link } from 'react-router-dom'; import { Play, Image as ImageIcon } from 'lucide-react'; import type { Movie } from '../types'; interface MovieCardProps { movie: Movie; className?: string; isDragging?: boolean; } export const MovieCard = ({ movie, className = '', isDragging = false }: MovieCardProps) => { const [imgError, setImgError] = useState(false); // Calculate progress percentage const progressPercent = movie.watchedTimestamp && movie.duration ? (movie.watchedTimestamp / movie.duration) * 100 : 0; const getImageUrl = (url: string) => { if (!url) return ''; let cleanUrl = url; if (url.startsWith('//')) { cleanUrl = `https:${url}`; } else if (!url.startsWith('http')) { cleanUrl = `https://${url}`; } return cleanUrl; }; return (
{movie.year} • 98% Match
)}