'use client'; import { QuoteIcon } from '@imphnen-frontend-service/shadcn-ui/atoms'; import { formatCMSImageDataToMedia } from 'apps/landing/src/lib/format'; import { TestimonialsSection } from 'apps/landing/src/payload-types'; import { motion, useInView } from 'framer-motion'; import Image from 'next/image'; import { useRef } from 'react'; export function Testimonials(props: TestimonialsSection) { const { title, subtitle, items, stats, joinTitle, joinText } = props; const ref = useRef(null); const isInView = useInView(ref, { once: true, amount: 0.2 }); const containerVariants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.1 } }, }; const itemVariants = { hidden: { y: 20, opacity: 0 }, visible: { y: 0, opacity: 1, transition: { duration: 0.5 } }, }; return (

{title.split(' ').map((word, i) => i === title.split(' ').length - 1 ? ( {word} ) : ( {word} ) )}

{subtitle}

{items?.map((t, idx) => (

“{t.quote}”

{(() => { const media = formatCMSImageDataToMedia(t.avatar); if (!media) return null; return ( {media.alt} ); })()}

{t.name}

{t.role}

))}

{joinTitle}

{joinText}

{stats?.map((s, idx) => (
{s.value}
{s.label}
))}
); }