// 自动生成:站点首页组件(源自底座 editorial 形态,品牌来自 @/site/brand) import { siteConfig } from "@/site/brand"; import { BookOpen, PenTool, ArrowRight, Star } from "lucide-react"; import { getTranslations } from "next-intl/server"; import { LocaleLink } from "@/components/locale-link"; import { SectionHeader } from "@/kit/section"; import { getHomeDataSafe } from "@/kit/home-data"; /** Editorial:AI 媒体 + 工具目录(Serif / 内容优先) */ const navItems = [ { label: "Stories", href: "/blog" }, { label: "Guides", href: "/ai-tools-for" }, { label: "Best Picks", href: "/best" }, { label: "Directory", href: "/tools" }, { label: "Rankings", href: "/rankings" }, { label: "Submit", href: "/submit" }, ]; const footerGroups = [ { title: "Read", links: [ { label: "Latest Stories", href: "/blog" }, { label: "Buying Guides", href: "/best" }, { label: "Use Case Guides", href: "/ai-tools-for" }, ], }, { title: "Directory", links: [ { label: "All Tools", href: "/tools" }, { label: "Community Rankings", href: "/rankings" }, { label: "Submit a Tool", href: "/submit" }, ], }, { title: "Company", links: [ { label: "Contact", href: "/contact" }, { label: "Terms", href: "/terms" }, { label: "Privacy", href: "/privacy" }, ], }, ]; async function SiteHome({ locale }: { locale: string }) { const t = await getTranslations("siteHome"); const th = await getTranslations("hero"); const data = await getHomeDataSafe(6); const featured = data.articles[0]; const editorPicks = data.editorsChoice.slice(0, 4); return (
{/* Masthead:黑色报头条(当日日期 + 期号),报纸头版签名 */}
{new Date().toLocaleDateString("en-US", { weekday: "long", year: "numeric", month: "long", day: "numeric" })} Est. 2026 Daily
{/* Masthead */}

{t("mastheadLabel")}

{th("title")}

{th("description")}

{/* Featured Story */} {featured && (
{t("featuredLabel")}

{featured.title}

{featured.description && (

{featured.description}

)} {t("featuredRead")}
)} {/* Editor's Picks */} {editorPicks.length > 0 && (
{t("picksEditorialLabel")}
{editorPicks.map((tool, i) => ( {String(i + 1).padStart(2, "0")}

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

{tool.taglineEn || tool.descriptionEn}

{(tool.ratingAvg ?? 0) > 0 && ( {(tool.ratingAvg ?? 0).toFixed(1)} )}
))}
)} {/* Best Lists(编辑内容型榜单) */} {data.collections.length > 0 && (
{data.collections.slice(0, 4).map((col) => (

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

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

{col.toolCount} {t("toolsCompared")}

))}
)} {/* Latest articles */} {data.articles.length > 1 && (
{data.articles.slice(1).map((article) => (

{article.title}

{article.description && (

{article.description}

)}
))}
)} {/* Community signal */} {data.latestReviews.length > 0 && (
{data.latestReviews.slice(0, 4).map((review, i) => (

"{review.content.slice(0, 140)} {review.content.length > 140 ? "..." : ""}"

))}
)}
); } export { SiteHome };