import React, { useState } from 'react'; import { AnimatePresence, motion } from 'framer-motion'; import { ChevronLeftIcon, ChevronRightIcon, QuoteIcon } from 'lucide-react'; import { SectionHeading } from '../SectionHeading'; import { useSite } from '../../api'; import { useLang } from '../../i18n/lang'; import { EditableItem } from '../../admin/Editable'; export function Testimonials() { const { testimonials } = useSite(); const { t } = useLang(); const [index, setIndex] = useState(0); const current = testimonials[Math.min(index, Math.max(testimonials.length - 1, 0))]; if (!current) return null; const go = (dir: number) => { setIndex((prev) => (prev + dir + testimonials.length) % testimonials.length); }; return (
); }