'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: '¿Cómo 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 nächsten 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 más rápido.' } }, { 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 zusätzlich kostenpflichtige Optionen wie Abos und Credit-Top-ups für erweiterte KI-Funktionen.', es: 'GreenLens incluye funciones gratuitas y también opciones de pago como suscripciones y créditos para funciones de IA más amplias.' } }, { question: { en: 'Can I use GreenLens offline?', de: 'Kann ich GreenLens offline nutzen?', es: '¿Puedo usar GreenLens sin conexión?' }, 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 benötigen eine Internetverbindung. Deine gespeicherte Sammlung, Pflegenotizen und Gieß-Erinnerungen sind offline verfügbar.', es: 'La identificación de plantas y el control de salud requieren conexión a internet. Tu colección guardada, notas de cuidado y recordatorios de riego están disponibles sin conexión.' } }, { question: { en: 'What kind of plants can I use GreenLens for?', de: 'Für welche Pflanzen kann ich GreenLens nutzen?', es: '¿Para qué 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 über 450 Pflanzenarten, darunter Zimmerpflanzen, Gartenpflanzen und Sukkulenten. Die App richtet sich an Pflanzenbesitzer, die Identifikation und Pflege an einem Ort wollen.', es: 'GreenLens cubre más de 450 especies de plantas, incluyendo plantas de interior, de jardín y suculentas. Está pensada para quienes quieren identificación y cuidado en un solo lugar.' } }, { question: { en: 'How do I start my plant collection?', de: 'Wie starte ich meine Pflanzensammlung?', es: '¿Cómo empiezo mi colección 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, prüfe 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 colección para mantener notas, recordatorios y cuidado en un solo lugar.' } } ]; const TEXT = { de: { tag: 'Fragen', h2: ['Häufig gestellte', 'Fragen'], desc: 'Alles, was du über 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]}

)}
))}
); }