diff --git a/app/wiki/[slug]/page.tsx b/app/wiki/[slug]/page.tsx index 266e67e..929b427 100644 --- a/app/wiki/[slug]/page.tsx +++ b/app/wiki/[slug]/page.tsx @@ -4,7 +4,7 @@ import { MDXRemote } from 'next-mdx-remote/rsc'; import rehypePrettyCode from 'rehype-pretty-code'; import rehypeSlug from 'rehype-slug'; import rehypeAutolinkHeadings from 'rehype-autolink-headings'; -import { Callout, Grid, Card, Steps, Step, InlineCode, CodeBlockContainer } from '@/components/mdx-components'; +import { Callout, Grid, Card, Steps, Step, InlineCode, CodeBlockContainer, API } from '@/components/mdx-components'; const mdxOptions = { mdxOptions: { @@ -43,6 +43,7 @@ const mdxComponents = { Card, Steps, Step, + API, // Custom Typography Überschreibungen code: InlineCode, pre: CodeBlockContainer, diff --git a/components/mdx-components.tsx b/components/mdx-components.tsx index 654d488..dd680a0 100644 --- a/components/mdx-components.tsx +++ b/components/mdx-components.tsx @@ -116,4 +116,46 @@ export function CodeBlockContainer({ children, ...props }: React.HTMLAttributes<
{children}
); +} + +export function API({ + method = 'GET', + route, + children +}: { + method?: string; + route: string; + children?: React.ReactNode; +}) { + const methodUpper = method.toUpperCase(); + + // Farben für die verschiedenen HTTP-Methoden + const methodStyles: Record = { + GET: 'bg-emerald-500/10 text-emerald-400 border-emerald-500/30', + POST: 'bg-blue-500/10 text-blue-400 border-blue-500/30', + PUT: 'bg-amber-500/10 text-amber-400 border-amber-500/30', + PATCH: 'bg-orange-500/10 text-orange-400 border-orange-500/30', + DELETE: 'bg-rose-500/10 text-rose-400 border-rose-500/30', + }; + + const badgeStyle = methodStyles[methodUpper] || 'bg-zinc-800 text-zinc-300 border-zinc-700'; + + return ( +
+ {/* Route & Methoden-Header */} +
+ + {methodUpper} + + /api/{route} +
+ + {/* Beschreibung / Inhalt */} + {children && ( +
+ {children} +
+ )} +
+ ); } \ No newline at end of file diff --git a/data/wiki/pages/api.mdx b/data/wiki/pages/api.mdx index ad6cc8e..51a3773 100644 --- a/data/wiki/pages/api.mdx +++ b/data/wiki/pages/api.mdx @@ -3,4 +3,21 @@ title: API updatedAt: "2026-08-05" --- -comming soon... \ No newline at end of file + + Diese Wiki-Seite ist derzeit nur zum Testen da. Bitte Informationen nicht anwenden! + + + + Es weder eine Authentifikation noch ein API-Key notwendig. + + +## API-Endpoints + +### Stream + + + Jetziges angezeigtes Lied abrufen + + + Lied zum Anzeigen festlegen + \ No newline at end of file