'use client'; import { useRef, useEffect } from 'react'; import Link from "next/link"; import { useTranslations } from "next-intl"; import { Project } from "@/lib/projects/types"; type props = { project: Project; locale: string; isTheLast?: boolean; index?: number; }; export const ProjectCard = ({ project, locale, isTheLast = false, index = 0 }: props) => { const num = String(index + 1).padStart(2, '0'); const cardRef = useRef(null); const t = useTranslations('projectCard'); useEffect(() => { const el = cardRef.current; if (!el) return; const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) { el.classList.add('visible'); observer.unobserve(el); } }, { threshold: 0.12 } ); observer.observe(el); return () => observer.disconnect(); }, []); return (
{/* Divider line */}
{/* Project number */}
{num}
{/* Left — image */}
{project.title}
{/* Right — content */}
{/* Category */}
{project.category}
{/* Title */}

{project.title}

({project.roles.join(', ')})

{project.dateLabel}

{/* Description */}

{project.description}

{/* CTA */}
{t('cta')}
{isTheLast &&
}
); };