'use client'; import { useRef, useEffect } from 'react'; import { useTranslations } from "next-intl"; export default function ApproachSection() { const sectionRef = useRef(null); const t = useTranslations('approach'); const features = [ { imagePath: '/icons/brain.svg', title: t('feature1.title'), text: t('feature1.text'), }, { imagePath: '/icons/building.svg', title: t('feature2.title'), text: t('feature2.text'), }, { imagePath: '/icons/people.svg', title: t('feature3.title'), text: t('feature3.text'), }, ]; useEffect(() => { const section = sectionRef.current; if (!section) return; const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { entry.target.querySelectorAll('.reveal').forEach((el) => { el.classList.add('visible'); }); observer.unobserve(entry.target); } }); }, { threshold: 0.15 } ); observer.observe(section); return () => observer.disconnect(); }, []); return (
{/* Section label */}
{t('sectionLabel')}
{features.map((feature, i) => (
{/* Icon container */}
{feature.title}
{feature.text}
))}
); }