import { ChevronLeft } from "lucide-react"; import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { ContentCard } from "@/components/content-card"; import { Button } from "@/components/ui/button"; import { ViewCounter } from "@/components/view-counter"; import { ContentService } from "@/services/content.service"; export const revalidate = 3600; // ISR: Revalider toutes les heures export async function generateMetadata({ params, }: { params: Promise<{ slug: string }>; }): Promise { const { slug } = await params; try { const content = await ContentService.getOne(slug); return { title: `${content.title} | MemeGoat`, description: content.description || `Regardez ce mème : ${content.title}`, openGraph: { images: [content.thumbnailUrl || content.url], }, }; } catch (_error) { return { title: "Mème non trouvé | MemeGoat" }; } } export default async function MemePage({ params, }: { params: Promise<{ slug: string }>; }) { const { slug } = await params; try { const content = await ContentService.getOne(slug); return (
Retour au flux

À propos de ce mème

Publié par

{content.author.displayName || content.author.username}

Date

{new Date(content.createdAt).toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric", })}

{content.description && (

Description

{content.description}

)}

Envie de créer votre propre mème ?

); } catch (_error) { notFound(); } }