'use client'; import Link from 'next/link'; import { Card } from '@/components/ui/Card'; import { Badge } from '@/components/ui/Badge'; import { Icons } from '@/components/ui/Icon'; import { getSourceName } from '@/lib/utils/source-names'; /** * Split person names by common delimiters (comma, Chinese comma, slash). * Does NOT split by space — Chinese names contain no spaces, and splitting * by space would break English names like "Tom Hanks". */ function splitPersonNames(str: string): string[] { return str.split(/[,,/]/).map(s => s.trim()).filter(Boolean); } interface VideoMetadataProps { videoData: any; source: string | null; title?: string | null; } export function VideoMetadata({ videoData, source, title }: VideoMetadataProps) { return (
{videoData?.vod_pic && ( {videoData.vod_name} )}

{videoData?.vod_name || title}

{source && ( {getSourceName(source)} )} {videoData?.type_name && ( {videoData.type_name} )} {videoData?.vod_year && ( {videoData.vod_year} )} {videoData?.vod_area && ( {videoData.vod_area} )} {videoData?.vod_lang && ( {videoData.vod_lang} )}
{videoData?.vod_content && (

{videoData.vod_content.replace(/<[^>]*>/g, '')}

)} {videoData?.vod_actor && (
主演: {splitPersonNames(videoData.vod_actor).map((name) => ( {name} ))}
)} {videoData?.vod_director && (
导演: {splitPersonNames(videoData.vod_director).map((name) => ( {name} ))}
)}
); }