'use client'; import { useEffect, useRef } from 'react'; import Link from 'next/link'; import { useTranslations } from 'next-intl'; type props = { locale: string; title: string; description: string; category: string; date: string; readTime?: string; cover?: string; }; export function ArticleHero({ locale, title, description, category, date, readTime, cover }: props) { const ref = useRef(null); const t = useTranslations('blogPage'); useEffect(() => { const section = ref.current; if (!section) return; section.querySelectorAll('.hero-reveal').forEach((el, i) => { setTimeout(() => { el.style.opacity = '1'; el.style.transform = 'translateY(0)'; }, 80 + i * 100); }); }, []); const formatted = new Date(date).toLocaleDateString(locale === 'fr' ? 'fr-FR' : 'en-US', { year: 'numeric', month: 'long', day: 'numeric', }); return (
{cover && (
)}
{t('backToBlog')}
{category} {readTime && ( <> {readTime} )}

{title}

{description}

{formatted}
{t('scrollPrompt')}
); }