nomadro/app/community/book/page.tsx
eric 9928c5185b Mount nav/book/community as native App Router routes in one Next process.
Replace reverse-proxy/iframe approach with @ebook/@community/@navmini imports under /nav /book /community so localhost:3000 serves all three products directly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 03:49:16 -05:00

32 lines
1.1 KiB
TypeScript

import type { Metadata } from "next";
import { getAllChapters, getBook } from "@community/lib/ebook/book.server";
import { CoverPage } from "@community/components/ebook/CoverPage";
import { buildBookMetadata } from "@community/lib/ebook/metadata";
import { getSiteConfig, getAdSlot } from "@community/lib/ebook/site-config.server";
import { getServerFeatures } from "@community/lib/ebook/features.server";
import { getLocale } from "@community/lib/ebook/i18n/server";
export async function generateMetadata(): Promise<Metadata> {
const locale = await getLocale();
return buildBookMetadata(locale);
}
export default async function BookCoverPage() {
const locale = await getLocale();
const book = getBook(locale);
const site = getSiteConfig();
const f = getServerFeatures();
const chapterMinutes = Object.fromEntries(
getAllChapters(locale).map((chapter) => [chapter.slug, chapter.readingMinutes])
);
return (
<CoverPage
book={book}
site={site}
chapterMinutes={chapterMinutes}
coverAdSlot={f.ads.enabled ? getAdSlot("coverSlot") : ""}
/>
);
}