Graduately/web/src/app/networks/year-1/[lesson]/page.tsx
FBukovina f7470d333c Add the Next.js web app and shared lesson content.
Move lessons out of the C sources into JSON so the web client can use the same material as the desktop app, and point release builds at desktop/.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 16:06:15 +02:00

23 lines
586 B
TypeScript

import { notFound } from 'next/navigation';
import { getLesson, getLessonIds } from '@/content';
import { LessonScreen } from '@/components/LessonScreen';
export async function generateStaticParams() {
const ids = await getLessonIds('networks');
return ids.map((lesson) => ({ lesson }));
}
export default async function NetworkLessonPage({
params,
}: {
params: Promise<{ lesson: string }>;
}) {
const { lesson: id } = await params;
try {
return <LessonScreen lesson={await getLesson('networks', id)} backHref="/networks/year-1" />;
} catch {
notFound();
}
}