'use client'; import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { useTranslation } from 'react-i18next'; import { HelpCircle, ChevronDown, Search } from 'lucide-react'; export default function FAQPage() { const { t } = useTranslation(); const [openIndex, setOpenIndex] = useState(null); const [searchTerm, setSearchTerm] = useState(''); const faqs = [ { question: t('faq.q1'), answer: t('faq.a1') }, { question: t('faq.q2'), answer: t('faq.a2') }, { question: t('faq.q3'), answer: t('faq.a3') }, { question: t('faq.q4'), answer: t('faq.a4') }, { question: t('faq.q5'), answer: t('faq.a5') }, { question: t('faq.q6'), answer: t('faq.a6') }, { question: t('faq.q7'), answer: t('faq.a7') }, { question: t('faq.q8'), answer: t('faq.a8') }, ]; const filteredFaqs = faqs.filter( (faq) => faq.question.includes(searchTerm) || faq.answer.includes(searchTerm) ); const toggleFAQ = (index) => { setOpenIndex(openIndex === index ? null : index); }; return (

{t('faq.pageTitle')}

{t('faq.pageDescription')}

setSearchTerm(e.target.value)} className="w-full pr-12 pl-4 py-4 bg-white border border-gray-200 rounded-2xl shadow-sm focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent text-gray-900 placeholder-gray-400" />
{filteredFaqs.map((faq, index) => ( {openIndex === index && (

{faq.answer}

)}
))}
{filteredFaqs.length === 0 && (

{t('faq.noResults')}

)}
); }