"use client"; import { useEffect, useState } from "react"; import { IconPlayerPauseFilled, IconPlayerPlayFilled, IconPoint, IconPointFilled } from '@tabler/icons-react'; type Testimonial = { name: string; title: string; avatar?: string; quote: string; }; type TestimonialsProps = { items: Testimonial[]; }; export default function Testimonials({ items }: TestimonialsProps) { const [activeIndex, setActiveIndex] = useState(0); const [isPlaying, setIsPlaying] = useState(true); const active = items[activeIndex]; if (!active) return null; useEffect(() => { if (items.length <= 1 || !isPlaying) return; const id = setInterval(() => { setActiveIndex((i) => (i + 1) % items.length); }, 5000); return () => clearInterval(id); }, [items.length, isPlaying]); return (
{/* header: avatar + name + title */}
{/* TODO: avatar */}
{active.name}
{active.title}
{active.quote}
); }