'use client'; import { memo } from 'react'; import Link from 'next/link'; import Image from 'next/image'; import { Card } from '@/components/ui/Card'; import { Badge } from '@/components/ui/Badge'; import { Icons } from '@/components/ui/Icon'; import { LatencyBadge } from '@/components/ui/LatencyBadge'; import { Video } from '@/lib/types'; interface VideoCardProps { video: Video; videoUrl: string; cardId: string; isActive: boolean; onCardClick: (e: React.MouseEvent, cardId: string, videoUrl: string) => void; } export const VideoCard = memo(({ video, videoUrl, cardId, isActive, onCardClick }) => { return (
onCardClick(e, cardId, videoUrl)} role="listitem" aria-label={`${video.vod_name}${video.vod_remarks ? ` - ${video.vod_remarks}` : ''}`} prefetch={false} > {/* Poster */}
{video.vod_pic ? ( {video.vod_name} { const target = e.currentTarget as HTMLImageElement; target.style.opacity = '0'; }} /> ) : (
)} {/* Fallback Icon */}
{/* Badge Container */}
{video.sourceName && ( {video.sourceName} )} {video.latency !== undefined && ( )}
{/* Overlay */}
{isActive && (
再次点击播放 →
)} {video.type_name && ( {video.type_name} )} {video.vod_year && (
{video.vod_year}
)}
{/* Info */}

{video.vod_name}

{video.vod_remarks && (

{video.vod_remarks}

)}
); }); VideoCard.displayName = 'VideoCard';