"use clients"; import React, { useEffect, useState } from "react"; import { motion } from "framer-motion"; import { SectionWrapper } from "src/hoc"; import { fadeIn, textVariant } from "src/utils/motion"; import { styles } from "src/style"; import { testimonials } from "src/constans"; import Image from "next/image"; import phi from "@img/adjustw.png"; import phi1 from "../../src/assets/phi1.png"; import phi2 from "../../src/assets/phi2.png"; import phi3 from "../../src/assets/phi3.png"; const Feedbacks = () => { const [activeIndex, setActiveIndex] = useState(0); useEffect(() => { const interval = setInterval(() => { setActiveIndex((prevIndex) => prevIndex === testimonials.length - 1 ? 0 : prevIndex + 1 ); }, 6000); // 5 seconds interval return () => clearInterval(interval); // Cleanup interval on component unmount }, []); console.log(activeIndex); return (
HI

{" "} Coffee taste always matters the most. With PHI, it will always be perfect. Phi means the golden ratio. If you brew your coffee with the golden ratio, it will always taste good. In the Phi section, there are three boxes that the barista on shift should fill. These are the main elements for adjusting the daily coffee recipe:

{testimonials.map((e, index) => ( setActiveIndex(index)} >

{e.title}

{activeIndex == index && (

{e.testimonial}

)}
))}
{/*
*/}

{" "} Your barista enters the daily recipe, which will be recorded in your database. You can view your adjustment chart see what’s happening in your bar, and check the quality of your coffee serving in your store.

); }; export default SectionWrapper(Feedbacks, "platform");