"use client";
import Link from "next/link";
import { motion } from "framer-motion";
import { categoryLabels, hotKeywords } from "@/lib/mock-data";
import { AppResource } from "@/lib/types";
import { BadgeCheck, ShieldCheck, Download, ArrowRight } from "lucide-react";
import { buildChannelUrl } from "@/lib/marketing";
import { useTrack } from "@/hooks/use-track";
import { TRACKING_EVENTS } from "@/lib/tracking-events";
export function SearchBar({ placeholder = "搜索资源..." }: { placeholder?: string }) {
return (
);
}
export function CategoryTabs({
active,
onChange,
}: {
active: string;
onChange: (value: string) => void;
}) {
return (
{Object.entries(categoryLabels).map(([key, label]) => (
))}
);
}
export function HeroSection() {
const { track } = useTrack();
return (
Download Nova
网盘资源下载,一站直达
每日更新,版本清晰,渠道可查。热门软件、学习资料、影音资源快速下载。
{hotKeywords.map((k) => (
{k}
))}
track(TRACKING_EVENTS.ctaClick, { position: "hero", target: "apps" })} className="cta-main">进入资源库
track(TRACKING_EVENTS.ctaClick, { position: "hero", target: "unlock" })} className="cta-sub">输入解锁码
);
}
export function SafetyBadge({ items }: { items: AppResource["safety"] }) {
return (
{items.includes("official") && }
{items.includes("verified") && }
{items.includes("clean") && }
);
}
export function AppCard({ app }: { app: AppResource }) {
const { track } = useTrack();
const primaryChannel = app.channels[0];
const downloadUrl = buildChannelUrl(primaryChannel?.href ?? "#", primaryChannel?.name ?? "direct", app.slug);
return (
{app.icon}
{app.name}
{app.subtitle}
{app.description}
{app.tags.map((tag) => (
{tag}
))}
{app.version}
{app.size}
{app.updatedAt}
);
}
export function AppGrid({ apps }: { apps: AppResource[] }) {
return ;
}
export function StatsPanel() {
const stats = [
{ k: "资源总数", v: "1,286" },
{ k: "今日更新", v: "27" },
{ k: "总下载量", v: "8.4M" },
{ k: "热门分类", v: "AI 工具" },
];
return (
{stats.map((s) => (
{s.k}
{s.v}
))}
);
}
export function UnlockSection() {
return (
更多下载方式
关注公众号可获取解锁码,会员可用更多下载线路。
);
}
export function Footer() {
return (
);
}