import { BackButton } from "@/components/ui"; import { getTutorialBySlug } from "@/lib/tutorials"; import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { MarkdownRenderer } from "./markdown-renderer"; type Props = { params: Promise<{ slug: string }>; }; export async function generateMetadata({ params }: Props): Promise { const { slug } = await params; const tutorial = await getTutorialBySlug(slug); if (!tutorial) { return { title: "Tutoriel non trouvé" }; } return { title: `${tutorial.title} | Jessy David`, description: tutorial.excerpt, }; } export default async function TutorialPage({ params }: Props) { const { slug } = await params; const tutorial = await getTutorialBySlug(slug); if (!tutorial) { notFound(); } const difficultyColors = { Débutant: "text-emerald-400 border-emerald-500/40", Intermédiaire: "text-amber-400 border-amber-500/40", Avancé: "text-rose-400 border-rose-500/40", }; return (
{/* Effets de fond */}
{/* Contenu */}
{/* Navigation retour */} {/* Header */}
{tutorial.category.name} {tutorial.difficulty} {tutorial.readTime}

{tutorial.title}

{tutorial.excerpt}

Publié le{" "} {new Date(tutorial.date).toLocaleDateString( "fr-FR", { day: "numeric", month: "long", year: "numeric", } )}
{/* Contenu Markdown */}
); }