'use client' import { useState } from 'react' import { motion, AnimatePresence } from 'framer-motion' import { ChevronDown } from 'lucide-react' interface FAQItem { q: string a: stringß } export function AnimatedFAQ({ faqs }: { faqs: FAQItem[] }) { const [openIndex, setOpenIndex] = useState(null) const toggleFAQ = (index: number) => { setOpenIndex(openIndex === index ? null : index) } return (
{faqs.map((faq, index) => ( toggleFAQ(index)} style={{ width: '100%', textAlign: 'left', background: 'none', border: 'none', cursor: 'pointer', padding: 0 }} whileHover={{ color: 'var(--primary-400)' }} transition={{ duration: 0.2 }} > {faq.q} {openIndex === index && ( {faq.a} )} ))}
) }