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