import { User } from "@/lib/api"; function isSafeImageUrl(url: string): boolean { try { const u = new URL(url); return u.protocol === "https:" || u.protocol === "http:"; } catch { return false; } } interface MovieMeta { movieTitle: string; releaseYear?: number; posterUrl?: string | null; rating?: number; comment?: string | null; watchedAt?: string | null; watchlistEntry?: boolean; } interface MovieCardProps { meta: MovieMeta; author: User; createdAt: Date; } function StarRating({ rating, max = 5 }: { rating: number; max?: number }) { return (
{meta.movieTitle} {year && {year}}
{isWatchlist ? (๐ Want to watch
) : ( <> {meta.rating !== undefined && (Watched {watchedDate}
)} > )} {meta.comment && ({meta.comment}
)}