Initial Paprika Next.js implementation

This commit is contained in:
2026-07-06 12:12:36 -04:00
commit 7d585484a6
38 changed files with 14824 additions and 0 deletions

31
app/[page]/page.tsx Normal file
View File

@@ -0,0 +1,31 @@
import { notFound } from "next/navigation";
import { LegacyPage } from "@/components/LegacyPage";
import { legacyPages, type LegacyPageKey } from "@/lib/legacy-pages";
const routablePages = new Set(Object.keys(legacyPages));
const replacedPages = new Set(["home", "start", "ask", "thanks"]);
export function generateStaticParams() {
return Object.keys(legacyPages)
.filter((page) => !replacedPages.has(page))
.map((page) => ({ page }));
}
export async function generateMetadata({ params }: { params: Promise<{ page: string }> }) {
const { page: pageParam } = await params;
if (!routablePages.has(pageParam)) return {};
const page = legacyPages[pageParam as LegacyPageKey];
return {
title: page.title.replace("Paprika - ", "")
};
}
export default async function StaticPage({ params }: { params: Promise<{ page: string }> }) {
const { page } = await params;
if (!routablePages.has(page) || replacedPages.has(page)) {
notFound();
}
return <LegacyPage pageKey={page as LegacyPageKey} />;
}