Repository Public
1import Link from "next/link";2import { notFound } from "next/navigation";3import { PageHeader, PreviewChip } from "@/components/ui/Bits";4import { Icon } from "@/components/ui/Icon";5import { getCourse } from "@/lib/content";6import { pad2 } from "@/lib/labels";7import { pageMeta } from "@/lib/seo";8import { diagramPath } from "@/modules/content-schema";9import { DIAGRAMS } from "@/modules/diagram-library/registry";1011export const metadata = pageMeta({ title: "Schémas interactifs", description: "Des schémas à manipuler pour comprendre les jetons, l’attention, le contexte, les agents, les outils et la sécurité.", path: "/schemas" });1213export default async function Schemas() {14 const course = await getCourse();15 const list = DIAGRAMS.filter((d) => course.diagrams.includes(d.id));16 if (!list.length) notFound(); // nothing published: the library does not exist for the public yet17 return (18 <>19 <PageHeader eyebrow="Schémas interactifs" title="Comprendre en manipulant" lede="Chaque schéma modélise une idée du cours. Vous changez un réglage, le schéma recalcule : rien n’y est une animation décorative. Tous se manipulent au clavier et offrent un équivalent textuel.">20 {course.mode === "preview" && <PreviewChip>Aperçu — schémas non encore révisés par l’enseignant</PreviewChip>}21 </PageHeader>22 <div className="shell py-10 md:py-14">23 <ol className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">24 {list.map((d) => (25 <li key={d.id}>26 <Link href={diagramPath(d.id)} className="card card-hover flex h-full flex-col p-5" data-diagram-link={d.id}>27 <span className="font-mono text-sm text-faint">Schéma {pad2(d.number)}</span>28 <h2 className="mt-2 text-[1.25rem]">{d.title}</h2>29 <p className="mt-2 text-[0.95rem] text-muted">{d.summary}</p>30 <span className="mt-auto inline-flex items-center gap-1.5 pt-4 text-sm font-medium text-blue">Ouvrir le schéma<Icon name="arrow" size={16} /></span>31 </Link>32 </li>33 ))}34 </ol>35 </div>36 </>37 );38}39