"use clients"; import React, { useEffect, useState } from "react"; import { motion } from "framer-motion"; import { SectionWrapper } from "src/hoc"; import { fadeIn, textVariant } from "src/utils/motion"; import { styles } from "src/style"; import Image from "next/image"; import phi from "@img/adjustw.png"; import phi1 from "../../src/assets/phi1.png"; import phi2 from "../../src/assets/phi2.png"; import phi3 from "../../src/assets/phi3.png"; import { useLocale, useTranslations } from "next-intl"; const phiData = () => { const t = useTranslations("phiData"); return [ { title: t("bcg.title"), desc: t("bcg.desc"), }, { title: t("oeg.title"), desc: t("oeg.desc"), }, { title: t("et.title"), desc: t("et.desc"), }, ]; }; const Phi = () => { const [activeIndex, setActiveIndex] = useState(0); console.log("object phiData().length", phiData().length); const t = useTranslations("phiData"); const locale = useLocale(); const isRTL = locale === "fa"; console.log(activeIndex); return (
{isRTL ? ( <> {" "} HI
) : ( <> {" "}
{" "} HI )}

{t("desc")}

{phiData().map((e, index) => ( setActiveIndex(index)} >

{e.title}

{activeIndex == index && (

{e.desc}

)}
))}
{/*
*/}

{t("endDesc")}

); }; export default SectionWrapper(Phi, "Phi");