"use client"; import { Reveal } from "@/components/landing-page/Reveal"; import React, { useState } from "react"; import { useTranslations } from "next-intl"; interface FAQItem { question: string; answer: string; } const FAQS: React.FC = () => { const t = useTranslations("LandingPage"); const faqs: FAQItem[] = [ { question: t("question1", { defaultValue: "Question1" }), answer: t("answer1", { defaultValue: "Answer1" }), }, { question: t("question2", { defaultValue: "Question2" }), answer: t("answer2", { defaultValue: "Answer2" }), }, { question: t("question3", { defaultValue: "Question3" }), answer: t("answer3", { defaultValue: "Answer3" }), }, { question: t("question4", { defaultValue: "Question4" }), answer: t("answer4", { defaultValue: "Answer4" }), }, ]; const [openIndex, setOpenIndex] = useState(null); const toggleFAQ = (index: number) => { setOpenIndex(openIndex === index ? null : index); }; return (
{/* Header */}
Faqs

Frequently Asked Questions

{/* FAQS Items */}
{faqs?.map((faq, index) => (
toggleFAQ(index)}>

{faq.question}

{openIndex === index ? "−" : "+"}
{openIndex === index &&

{faq.answer}

}
))}
); }; export default FAQS;