2024-12-10 13:51:14 +00:00
|
|
|
|
"use client";
|
2024-12-17 14:27:48 +00:00
|
|
|
|
import { Reveal } from "@/components/landing-page/Reveal";
|
2024-12-10 13:51:14 +00:00
|
|
|
|
import React, { useState } from "react";
|
2025-02-15 14:43:19 +00:00
|
|
|
|
import { useTranslations } from "next-intl";
|
2025-08-25 09:33:36 +00:00
|
|
|
|
import Image from "next/image";
|
2024-12-10 13:51:14 +00:00
|
|
|
|
|
|
|
|
|
|
interface FAQItem {
|
|
|
|
|
|
question: string;
|
|
|
|
|
|
answer: string;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const FAQS: React.FC = () => {
|
2025-02-15 14:43:19 +00:00
|
|
|
|
const t = useTranslations("LandingPage");
|
|
|
|
|
|
|
2024-12-10 13:51:14 +00:00
|
|
|
|
const faqs: FAQItem[] = [
|
|
|
|
|
|
{
|
2025-07-06 09:23:45 +00:00
|
|
|
|
question: t("question1", { defaultValue: "Question1" }),
|
|
|
|
|
|
answer: t("answer1", { defaultValue: "Answer1" }),
|
2024-12-10 13:51:14 +00:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-07-06 09:23:45 +00:00
|
|
|
|
question: t("question2", { defaultValue: "Question2" }),
|
|
|
|
|
|
answer: t("answer2", { defaultValue: "Answer2" }),
|
2024-12-10 13:51:14 +00:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-07-06 09:23:45 +00:00
|
|
|
|
question: t("question3", { defaultValue: "Question3" }),
|
|
|
|
|
|
answer: t("answer3", { defaultValue: "Answer3" }),
|
2024-12-10 13:51:14 +00:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-07-06 09:23:45 +00:00
|
|
|
|
question: t("question4", { defaultValue: "Question4" }),
|
|
|
|
|
|
answer: t("answer4", { defaultValue: "Answer4" }),
|
2024-12-10 13:51:14 +00:00
|
|
|
|
},
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const [openIndex, setOpenIndex] = useState<number | null>(null);
|
|
|
|
|
|
|
|
|
|
|
|
const toggleFAQ = (index: number) => {
|
|
|
|
|
|
setOpenIndex(openIndex === index ? null : index);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
2024-12-17 14:27:48 +00:00
|
|
|
|
<div className="max-w-3xl mx-auto h-screen p-6 mt-20">
|
2024-12-10 13:51:14 +00:00
|
|
|
|
{/* Header */}
|
2024-12-17 14:27:48 +00:00
|
|
|
|
<Reveal>
|
|
|
|
|
|
<div className="flex items-center justify-center mb-6">
|
2025-08-25 09:33:36 +00:00
|
|
|
|
<Image
|
|
|
|
|
|
width={1920}
|
|
|
|
|
|
height={1080}
|
|
|
|
|
|
src="/assets/icons-faqs.png"
|
|
|
|
|
|
alt="Faqs"
|
|
|
|
|
|
className="h-12 w-12"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<h2 className="ml-4 text-lg lg:text-2xl font-bold text-gray-800 dark:text-white">
|
|
|
|
|
|
Frequently Asked Questions
|
|
|
|
|
|
</h2>
|
2024-12-17 14:27:48 +00:00
|
|
|
|
</div>
|
2024-12-10 13:51:14 +00:00
|
|
|
|
|
2024-12-17 14:27:48 +00:00
|
|
|
|
{/* FAQS Items */}
|
|
|
|
|
|
<div className="space-y-4">
|
2025-02-15 14:43:19 +00:00
|
|
|
|
{faqs?.map((faq, index) => (
|
2025-08-25 09:33:36 +00:00
|
|
|
|
<div
|
|
|
|
|
|
key={index}
|
|
|
|
|
|
className="border-b border-gray-300 pb-2 cursor-pointer"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
className="flex justify-between items-center"
|
|
|
|
|
|
onClick={() => toggleFAQ(index)}
|
|
|
|
|
|
>
|
|
|
|
|
|
<h3 className="text-sm font-semibold text-gray-800 dark:text-white">
|
|
|
|
|
|
{faq.question}
|
|
|
|
|
|
</h3>
|
|
|
|
|
|
<span className="text-gray-500 dark:text-white text-xl">
|
|
|
|
|
|
{openIndex === index ? "−" : "+"}
|
|
|
|
|
|
</span>
|
2024-12-17 14:27:48 +00:00
|
|
|
|
</div>
|
2025-08-25 09:33:36 +00:00
|
|
|
|
{openIndex === index && (
|
|
|
|
|
|
<p className="text-gray-600 dark:text-white mt-2 text-sm">
|
|
|
|
|
|
{faq.answer}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
)}
|
2024-12-10 13:51:14 +00:00
|
|
|
|
</div>
|
2024-12-17 14:27:48 +00:00
|
|
|
|
))}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Reveal>
|
2024-12-10 13:51:14 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default FAQS;
|