import classNames from "classnames" import { useState } from "react" import NextImage from "../elements/image" import CustomLink from "../elements/custom-link" const TestimonialsGroup = ({ data }) => { // Only show one testimonial at a time const [selectedTestimonialIndex, setSelectedTestimonialIndex] = useState(0) const selectedTestimonial = data.testimonials[selectedTestimonialIndex] return (

{data.title}

{data.description}

{data.link.text} {/* Current testimonial card */}

"{selectedTestimonial.text}"

{selectedTestimonial.authorName}

{selectedTestimonial.authorTitle}

Read story
{/* Change selected testimonial (only if there is more than one) */} {data.testimonials.length > 1 && (
{data.testimonials.map((testimonial, index) => (
)} {/* Logos list */}
{data.logos.map((logo) => ( ))}
) } export default TestimonialsGroup