'use client'; import React, { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Card } from '@/components/ui/Card'; interface FAQProps { t: any; } export const FAQ: React.FC = ({ t }) => { const [openIndex, setOpenIndex] = useState(null); const defaultQuestions = [ 'account', 'static_vs_dynamic', 'forever', 'file_type', 'analytics', ]; const questions = t?.faq?.questions ? Array.isArray(t.faq.questions) ? t.faq.questions : Object.keys(t.faq.questions).length > 5 ? Object.keys(t.faq.questions).slice(0, 12) : defaultQuestions : defaultQuestions; return (

{t.faq.title}

{questions.map((key: string, index: number) => ( setOpenIndex(openIndex === index ? null : index)} >

{t.faq.questions[key]?.question || t.faq.questions[key]?.question || key}

{openIndex === index && (
{t.faq.questions[key]?.answer || t.faq.questions[key]?.answer || ''}
)}
))}
View All Questions →
); };