31 lines
850 B
TypeScript
31 lines
850 B
TypeScript
import { getWikiPageBySlug } from '@/lib/wiki';
|
|
import { notFound } from 'next/navigation';
|
|
|
|
type PageProps = {
|
|
params: Promise<{
|
|
slug: string;
|
|
}>;
|
|
};
|
|
|
|
export default async function Page({ params }: PageProps) { const { slug } = await params;
|
|
const article = await getWikiPageBySlug(slug);
|
|
|
|
if (!article) {
|
|
notFound(); // Zeigt die 404-Seite, wenn z. B. installation.md nicht existiert
|
|
}
|
|
|
|
return (
|
|
<article className="max-w-3xl mx-auto p-6">
|
|
<h1 className="text-3xl font-bold mb-2">{article.title}</h1>
|
|
{article.updatedAt && (
|
|
<p className="text-sm text-gray-500 mb-6">Stand: {article.updatedAt}</p>
|
|
)}
|
|
|
|
{/* Gerendertes Markdown-HTML anzeigen */}
|
|
<div
|
|
className="prose max-w-none"
|
|
dangerouslySetInnerHTML={{ __html: article.contentHtml }}
|
|
/>
|
|
</article>
|
|
);
|
|
} |