translation bug fixed
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { useState } from "react";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { ChevronDown } from "lucide-react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useLanguage } from "@/context/language-context";
|
||||
|
||||
interface FaqItem {
|
||||
questionKey: string;
|
||||
@@ -15,7 +15,7 @@ interface FaqProps {
|
||||
}
|
||||
|
||||
export function FAQ({ items }: FaqProps) {
|
||||
const t = useTranslations();
|
||||
const {t} = useLanguage();
|
||||
const [openIndex, setOpenIndex] = useState<number | null>(0);
|
||||
|
||||
const defaultItems: FaqItem[] = [
|
||||
@@ -60,7 +60,7 @@ export function FAQ({ items }: FaqProps) {
|
||||
className="text-center mb-16"
|
||||
>
|
||||
<h2 className="text-4xl font-bold text-gray-900 mb-4">
|
||||
{t("faq.title")}
|
||||
{t.faq.title}
|
||||
</h2>
|
||||
<div className="w-20 h-1 bg-blue-600 mx-auto rounded-full" />
|
||||
</motion.div>
|
||||
@@ -81,7 +81,7 @@ export function FAQ({ items }: FaqProps) {
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-lg font-semibold text-gray-900 flex-1">
|
||||
{t(item.questionKey)}
|
||||
{t.faq.items[idx].question}
|
||||
</h3>
|
||||
<motion.div
|
||||
animate={{ rotate: openIndex === idx ? 180 : 0 }}
|
||||
@@ -104,7 +104,7 @@ export function FAQ({ items }: FaqProps) {
|
||||
>
|
||||
<div className="bg-blue-50 p-6 rounded-b-lg border-t border-gray-200">
|
||||
<p className="text-gray-700 leading-relaxed">
|
||||
{t(item.answerKey)}
|
||||
{t.faq.items[idx].answer}
|
||||
</p>
|
||||
</div>
|
||||
</motion.div>
|
||||
|
||||
Reference in New Issue
Block a user