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>
23 lines
863 B
TypeScript
23 lines
863 B
TypeScript
import type { Metadata } from "next";
|
|
import { notFound } from "next/navigation";
|
|
import SiteShell from "@community/components/SiteShell";
|
|
import VideoDetailClient from "@community/components/VideoDetailClient";
|
|
import { api } from "@community/lib/api";
|
|
|
|
export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise<Metadata> {
|
|
const { slug } = await params;
|
|
const video = await api.getVideo(slug).catch(() => null);
|
|
return { title: video ? `${video.title} · nomadro` : "视频 · nomadro" };
|
|
}
|
|
|
|
export default async function VideoDetailPage({ params }: { params: Promise<{ slug: string }> }) {
|
|
const { slug } = await params;
|
|
const video = await api.getVideo(slug).catch(() => null);
|
|
if (!video) notFound();
|
|
return (
|
|
<SiteShell showFooter>
|
|
<VideoDetailClient video={video} />
|
|
</SiteShell>
|
|
);
|
|
}
|