'use client'; import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { useLang } from '@/context/LangContext'; const faqs = [ { question: { en: 'How does GreenLens identify a plant?', de: 'Wie erkennt GreenLens eine Pflanze?', es: 'Como identifica GreenLens una planta?' }, answer: { en: 'GreenLens analyzes the plant photo and combines that with app-side care guidance so you can move from scan to next steps faster.', de: 'GreenLens analysiert das Pflanzenfoto und verbindet das Ergebnis mit Pflegehinweisen in der App, damit du schneller zu klaren naechsten Schritten kommst.', es: 'GreenLens analiza la foto de la planta y combina el resultado con indicaciones de cuidado dentro de la app para que avances mas rapido.' } }, { question: { en: 'Is GreenLens free to use?', de: 'Ist GreenLens kostenlos?', es: 'Es GreenLens gratuito?' }, answer: { en: 'GreenLens includes free functionality plus paid options such as subscriptions and credit top-ups for advanced AI features.', de: 'GreenLens bietet kostenlose Funktionen und zusaetzlich kostenpflichtige Optionen wie Abos und Credit-Top-ups fuer erweiterte KI-Funktionen.', es: 'GreenLens incluye funciones gratuitas y tambien opciones de pago como suscripciones y creditos para funciones de IA mas umfangreiche.' } }, { question: { en: 'Can I use GreenLens offline?', de: 'Kann ich GreenLens offline nutzen?', es: 'Puedo usar GreenLens sin conexion?' }, answer: { en: 'Plant identification and health checks require an internet connection. Your saved collection, care notes, and watering reminders are available offline.', de: 'Pflanzenidentifikation und Gesundheitscheck benoetigen eine Internetverbindung. Deine gespeicherte Sammlung, Pflegenotizen und Giess-Erinnerungen sind offline verfuegbar.', es: 'La identificacion de plantas y el control de salud requieren conexion a internet. Tu coleccion guardada, notas de cuidado y recordatorios de riego estan disponibles sin conexion.' } }, { question: { en: 'What kind of plants can I use GreenLens for?', de: 'Fuer welche Pflanzen kann ich GreenLens nutzen?', es: 'Para que tipo de plantas puedo usar GreenLens?' }, answer: { en: 'GreenLens covers 450+ plant species including houseplants, garden plants, and succulents. It is built for everyday plant owners who want identification and care guidance in one place.', de: 'GreenLens umfasst ueber 450 Pflanzenarten, darunter Zimmerpflanzen, Gartenpflanzen und Sukkulenten. Die App richtet sich an Pflanzenbesitzer, die Identifikation und Pflege an einem Ort wollen.', es: 'GreenLens cubre mas de 450 especies de plantas, incluyendo plantas de interior, de jardin y suculentas. Esta pensada para quienes quieren identificacion y cuidado en un solo lugar.' } }, { question: { en: 'How do I start my plant collection?', de: 'Wie starte ich meine Pflanzensammlung?', es: 'Como empiezo mi coleccion de plantas?' }, answer: { en: 'Start with a scan, review the result, and save the plant to your collection to keep notes, reminders, and follow-up care in one place.', de: 'Starte mit einem Scan, pruefe das Ergebnis und speichere die Pflanze in deiner Sammlung, damit Notizen, Erinnerungen und Pflege an einem Ort bleiben.', es: 'Empieza con un escaneo, revisa el resultado y guarda la planta en tu coleccion para mantener notas, recordatorios y cuidado en un solo lugar.' } } ]; const TEXT = { de: { tag: 'Fragen', h2: ['Haeufig gestellte', 'Fragen'], desc: 'Alles, was du ueber GreenLens und den Einstieg wissen musst.' }, en: { tag: 'Questions', h2: ['Frequently Asked', 'Questions'], desc: 'Everything you need to know about GreenLens and getting started.' }, es: { tag: 'Preguntas', h2: ['Preguntas', 'Frecuentes'], desc: 'Todo lo que necesitas saber sobre GreenLens y el inicio.' }, } export default function FAQ() { const { lang } = useLang(); const [activeIndex, setActiveIndex] = useState(null); const text = TEXT[lang]; return (
{text.tag}

{text.h2[0]} {text.h2[1]}

{text.desc}

{faqs.map((faq, index) => (
setActiveIndex(activeIndex === index ? null : index)} >

{faq.question[lang]}

{activeIndex === index && (

{faq.answer[lang]}

)}
))}
); }