import { BookOpen, PenTool, ArrowRight, Star } from "lucide-react"; import { LocaleLink } from "@/components/locale-link"; import { SectionHeader } from "../shared/section"; import { getHomeDataSafe } from "../shared/home-data"; import type { ThemeModule } from "../types"; /** Editorial:AI 媒体 + 工具目录(Serif / 内容优先) */ const brand = { name: "The AI Ledger", tagline: "Independent journalism on AI tools, with a community-ranked directory.", headline: "AI tools, reviewed and ranked", subheadline: "Guides, comparisons and a community-powered directory of the best AI tools.", }; 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 EditorialHome({ locale }: { locale: string }) { const data = await getHomeDataSafe(6); const featured = data.articles[0]; const editorPicks = data.editorsChoice.slice(0, 4); return (
{/* Masthead */}

Independent AI Coverage

{brand.headline}

{brand.subheadline}

{/* Featured Story */} {featured && (
Featured story

{featured.title}

{featured.description && (

{featured.description}

)} Read the story
)} {/* Editor's Picks */} {editorPicks.length > 0 && (
Editor's picks
{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} tools compared

))}
)} {/* 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 const editorialTheme: ThemeModule = { id: "editorial", brand, HomePage: EditorialHome, }; export { navItems as editorialNavItems, footerGroups as editorialFooterGroups };