import React, { useState } from 'react'; import { ChevronDown, ChevronUp } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { trackFAQInteraction } from '../services/gtm'; export function FAQSection() { const { t } = useTranslation(); const [openItem, setOpenItem] = useState(null); const faqs = t('faq.questions', { returnObjects: true }) as Array<{ question: string; answer: string; category?: string; }>; const toggleItem = (index: number) => { const isOpening = openItem !== index; const question = faqs[index]?.question || ''; // Track FAQ interaction trackFAQInteraction(question, isOpening ? 'open' : 'close'); setOpenItem(prev => prev === index ? null : index); }; const faqSchema = { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": faqs.map(faq => ({ "@type": "Question", "name": faq.question, "acceptedAnswer": { "@type": "Answer", "text": faq.answer } })) }; return (