"use client"; import { useState, useEffect } from "react"; import styles from "@/app/features/[slug]/feature-page.module.css"; import SafeImage from "./SafeImage"; import { Star } from "lucide-react"; interface Testimonial { quote: string; author: string; role: string; rating: number; image: string; } export default function TestimonialSlider({ testimonials }: { testimonials: Testimonial[] }) { const [currentIndex, setCurrentIndex] = useState(0); useEffect(() => { const interval = setInterval(() => { setCurrentIndex((prev) => (prev + 1) % testimonials.length); }, 5000); // 5 seconds per slide return () => clearInterval(interval); }, [testimonials.length]); const current = testimonials[currentIndex]; return (
"{current.quote}"