Files
psalmtafel-webservice/app/wiki/[slug]/page.tsx
T

28 lines
700 B
TypeScript

import { getWikiPageBySlug } from '@/lib/wiki';
import { notFound } from 'next/navigation';
import { MDXRemote } from 'next-mdx-remote/rsc';
import { Callout } from '@/components/markdown/Callout';
const components = {
Callout,
};
type PageProps = {
params: Promise<{
slug: string;
}>;
};
export default async function Page({ params }: PageProps) {
const { slug } = await params;
const article = await getWikiPageBySlug(slug);
return (
<article className="prose prose-invert max-w-none p-6">
<h1>{article.title}</h1>
{/* Direkte MDX-Rendering-Komponente von Next.js */}
<MDXRemote source={article.rawContent} components={components} />
</article>
);
}