'use client'; import { useEffect, useRef } from 'react'; import Link from 'next/link'; import { useTranslations } from "next-intl"; type props = { title: string; description: string; dateLabel: string; locale: string; cover?: string; }; export function ProjectHero({ title, description, dateLabel, locale, cover }: props) { const ref = useRef(null); const t = useTranslations('projectPage.hero'); useEffect(() => { const section = ref.current; if (!section) return; const items = section.querySelectorAll('.hero-reveal'); items.forEach((el, i) => { setTimeout(() => { el.style.opacity = '1'; el.style.transform = 'translateY(0)'; }, 80 + i * 100); }); }, []); return (
{/* Background cover image */} {cover && (
)} {/* Top zone: clears the fixed header (~91px) + anchors the back link */}
{t('backToProjects')}
{/* Main content — centred in the remaining visible area */}
{/* Category pill */}
{dateLabel}
{/* Title */}

{title}

{/* Description */}

{description}

{/* Scroll indicator */}
{t('scrollPrompt')}
); }