"use client"; import Link from "next/link"; import { TOPICS_DISPLAY, EBOOKS_DISPLAY, VIDEO_COURSES_DISPLAY } from "@/app/data/vip.mock"; import styles from "../vip.module.css"; import { NetdiskDownloadsSection } from "@/app/components/NetdiskDownloadsSection"; type TopicEbookShowcaseProps = { onLockedClick?: () => void; /** VIP 首页:点击「私密社群」打开社群登录信息弹窗 */ onCommunityCardClick?: () => void; }; export function TopicEbookShowcase({ onLockedClick, onCommunityCardClick, }: TopicEbookShowcaseProps) { return (
{/* 模块展示 */}

模块

{TOPICS_DISPLAY.map((t) => { const { id, href } = t; const isLocked = "locked" in t && t.locked && onLockedClick; const isCommunityModal = id === "community" && onCommunityCardClick; const content = ( {isLocked && ( 🔒 )} {t.icon} {t.title} {t.desc} ); if (isLocked) { return ( ); } if (isCommunityModal) { return ( ); } if (href) { return ( {content} ); } return (
{content}
); })}
{/* 视频教程展示 - 参考 digital 资源导航,至少 4 个 */}

视频教程

{VIDEO_COURSES_DISPLAY.map((v) => { const { id, href, icon, title, desc } = v; return href ? ( {icon} {title} {desc} ) : (
{icon} {title} {desc}
); })}
{/* 电子书展示 */}

电子书

{EBOOKS_DISPLAY.map((e) => { const { id, href } = e; const isFree = "free" in e && e.free; const isLocked = "locked" in e && e.locked && onLockedClick; const cardContent = ( <> 📖
《{e.title}》 {isFree && ( 免费 )} {isLocked && ( 🔒 )}
{e.desc}
{isLocked ? "开通VIP解锁 →" : "阅读 →"}
); if (isLocked) { return ( ); } return href ? ( {cardContent} ) : (
{cardContent}
); })}
{/* 首页网盘下载(放在电子书下方) */}
); }