import { Link } from "@tanstack/react-router" import { StarDisplay } from "@/components/star-display" import { Card, CardContent } from "@/components/ui/card" import { posterUrl } from "@/lib/api/client" import type { MovieDto } from "@/lib/api/common" type MovieCardProps = { movie: MovieDto rating?: number comment?: string subtitle?: string variant?: "compact" | "full" action?: React.ReactNode } export function MovieCard({ movie, rating, comment, subtitle, variant = "full", action }: MovieCardProps) { if (variant === "compact") { return (
{movie.poster_path && }

{movie.title}

{subtitle &&

{subtitle}

} {comment &&

{comment}

}
{rating != null && } ) } return (
{movie.poster_path && }

{movie.title}

{movie.release_year}{movie.director && ` ยท ${movie.director}`}

{rating != null &&
} {comment &&

{comment}

}
{action &&
e.preventDefault()}>{action}
}
) }