"use client"; import type { Video } from "@/lib/api"; import { formatDuration, formatDate, TOPICS } from "@/lib/api"; import Image from "next/image"; interface Props { video: Video; } export default function VideoCard({ video }: Props) { const scoreColor = video.score >= 70 ? "var(--primary)" : video.score >= 40 ? "#f59e0b" : "#6b7280"; return ( {/* Thumbnail */}
{video.thumbnail_url ? ( {video.title} ) : (
)} {/* Score badge */} {video.score.toFixed(0)}/100 {/* Duration */} {formatDuration(video.duration_seconds)} {/* Chapters indicator */} {video.has_chapters && ( 📑 Chapitres )}
{/* Body */}

{video.title}

📺 {video.channel} 📅 {formatDate(video.published_at)} 👁 {video.view_count.toLocaleString("fr-FR")} {video.like_count > 0 && ( 👍 {video.like_count.toLocaleString("fr-FR")} )}
{/* Topics */} {video.topics.length > 0 && (
{video.topics.slice(0, 3).map((t) => ( {TOPICS[t] ?? t} ))}
)}
); }