'use client'; import { useEffect, useRef } from 'react'; import type { PublicTestimonio } from '@/lib/funnel/public-queries'; function iniciales(nombre: string): string { return nombre .split(/\s+/) .slice(0, 2) .map((p) => p[0]?.toUpperCase() ?? '') .join(''); } function Estrellas({ rating }: { rating: number }) { return (
{[1, 2, 3, 4, 5].map((n) => ( ))}
); } export default function TestimoniosCliente({ testimonios }: { testimonios: PublicTestimonio[] }) { const sectionRef = useRef(null); useEffect(() => { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { entry.target.classList.add('opacity-100', 'translate-y-0'); entry.target.classList.remove('opacity-0', 'translate-y-6'); } }); }, { threshold: 0.1 } ); const elements = sectionRef.current?.querySelectorAll('.reveal'); elements?.forEach((el) => observer.observe(el)); return () => observer.disconnect(); }, []); return (
Testimonios

Lo que dicen
quienes ya reformaron.

{testimonios.map((t, i) => (
{t.texto}
{t.fotos.length > 0 && (
{t.fotos.map((url, idx) => ( // eslint-disable-next-line @next/next/no-img-element ))}
)}
))}
); }