"use client"; import { useTranslations } from "next-intl"; import { useEffect, useRef } from "react"; export default function ProblemSection() { const t = useTranslations("ProblemSection"); const problems = t.raw("problems") as Array<{ problem: string; description: string }>; const sectionRef = useRef(null); useEffect(() => { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { entry.target.classList.add("animate-visible"); observer.unobserve(entry.target); } }); }, { threshold: 0.1 } ); const animatedElements = sectionRef.current?.querySelectorAll(".animate-on-scroll"); animatedElements?.forEach((el) => observer.observe(el)); return () => observer.disconnect(); }, []); return (
{t("title")}

{t("subtitle")}

{t("description")}

{problems.map((item, index) => (
{index === 0 && ( )} {index === 1 && ( )} {index === 2 && ( )}

{item.problem}

{item.description}

))}
); }