import { CalendarDays, Clock3, Eye } from "lucide-react"; import type { VideoDetail } from "@/types"; import { formatCount } from "@/lib/format"; type Props = { video: VideoDetail; }; /** * 详情页标题块。 * * 视觉: * - meta:一组小胶囊(来源、画质、时长、观看数、发布时间) * 每个胶囊有自己的语义色彩,避免传统 "·" 分隔列表的列表感。 * - 标题:大、粗、最高两行,位于 meta 下方 */ export function VideoMetaHeader({ video }: Props) { const source = (video.sourceLabel ?? "").trim(); const quality = (video.quality ?? "").trim(); const duration = (video.duration ?? "").trim(); const published = (video.publishedAt ?? "").trim(); const sourceKind = sourceKindFromLabel(source); return (

{video.title}

); } // 根据 sourceLabel 识别网盘类型,用于胶囊配色。 function sourceKindFromLabel(label: string): string { const value = label.toLowerCase(); if (value.includes("夸克") || value.includes("quark")) return "quark"; if (value.includes("115") || value.includes("p115")) return "p115"; if (value.includes("123") || value.includes("p123")) return "p123"; if (value.includes("pikpak")) return "pikpak"; if (value.includes("沃盘") || value.includes("wopan") || value.includes("联通")) return "wopan"; if (value.includes("光鸭") || value.includes("guangyapan") || value.includes("guangya")) return "guangyapan"; if (value.includes("onedrive") || value.includes("one drive")) return "onedrive"; if (value.includes("本地") || value.includes("localstorage") || value.includes("local storage")) return "localstorage"; return ""; }