// 自动生成:站点首页组件(源自底座 classic 形态,品牌来自 @/site/brand) import { siteConfig } from "@/site/brand"; import { Search, TrendingUp, Sparkles, Clock, Award, LayoutGrid, MessageSquareQuote } from "lucide-react"; import { getTranslations } from "next-intl/server"; import { ToolCard, ToolCardGrid } from "@/components/tool-card"; import { LocaleLink } from "@/components/locale-link"; import { SectionHeader } from "@/kit/section"; import { ThemeHeader } from "@/kit/theme-header"; import { ThemeFooter } from "@/kit/theme-footer"; import { getHomeDataSafe } from "@/kit/home-data"; /** Classic:专业 AI Directory(Clean / Dense / Professional) */ const navItems = [ { label: "Discover", href: "/tools" }, { label: "Categories", href: "/tools" }, { label: "Use Cases", href: "/ai-tools-for" }, { label: "Best Lists", href: "/best" }, { label: "Rankings", href: "/rankings" }, { label: "Blog", href: "/blog" }, { label: "Submit", href: "/submit" }, ]; const footerGroups = [ { title: "Discover", links: [ { label: "All Tools", href: "/tools" }, { label: "Use Cases", href: "/ai-tools-for" }, { label: "Best Lists", href: "/best" }, { label: "Rankings", href: "/rankings" }, ], }, { title: "Community", links: [ { label: "Submit a Tool", href: "/submit" }, { label: "Blog", href: "/blog" }, { label: "Dashboard", href: "/dashboard" }, ], }, { title: "Legal", links: [ { label: "Terms", href: "/terms" }, { label: "Privacy", href: "/privacy" }, { label: "Contact", href: "/contact" }, ], }, ]; async function SiteHome({ locale }: { locale: string }) { const t = await getTranslations("siteHome"); const th = await getTranslations("hero"); const data = await getHomeDataSafe(8); return (
{/* Hero */}

{th("title")}

{th("description")}

{/* 统计条(深色 Hero 内的白色数字) */}
{[ { v: "1,000+", l: "AI tools" }, { v: "14", l: "Categories" }, { v: "7", l: "Rankings" }, ].map((s) => (
{s.v}
{s.l}
))}
{t("popularLabel")} {t.raw("popularSearches").map((q: string) => ( {q} ))}
{/* Trending */} {data.trending.length > 0 && (
)} {/* Categories */} {data.categories.length > 0 && (
{data.categories.slice(0, 10).map((category) => (

{locale === "zh" && category.nameZh ? category.nameZh : category.nameEn}

{category.toolCount} tools

))}
)} {/* New + Editor's Choice 两列 */}
{data.newest.length > 0 && (
)} {data.editorsChoice.length > 0 && (
)}
{/* Use Cases */} {data.useCases.length > 0 && (
{data.useCases.slice(0, 12).map((uc) => ( {locale === "zh" && uc.nameZh ? uc.nameZh : uc.nameEn} {uc.toolCount} ))}
)} {/* Best Lists */} {data.collections.length > 0 && (
{data.collections.slice(0, 3).map((col) => (

{locale === "zh" && col.nameZh ? col.nameZh : col.nameEn}

{locale === "zh" && col.introZh ? col.introZh : col.introEn}

{col.toolCount} tools

))}
)} {/* Latest Reviews */} {data.latestReviews.length > 0 && (
{data.latestReviews.map((review, i) => (
{review.authorName} on {review.toolName} {review.rating}/5

{review.content}

))}
)} {/* Submit CTA */}

Built an AI tool?

Submit it to {siteConfig.brand.name} and get discovered by thousands of users looking for tools like yours.

Submit your tool
); } export { SiteHome };