nvis-fe-cms-libs 1.1.16 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4450,18 +4450,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
4450
4450
|
);
|
|
4451
4451
|
};
|
|
4452
4452
|
const FaqSection = ({ data, t, isDarkMode }) => {
|
|
4453
|
-
const [activeIndex, setActiveIndex] = require$$0.useState(
|
|
4453
|
+
const [activeIndex, setActiveIndex] = require$$0.useState(-1);
|
|
4454
4454
|
const faqs = require$$0.useMemo(() => {
|
|
4455
4455
|
if ((data == null ? void 0 : data.sectionDataBindingItems) && Array.isArray(data.sectionDataBindingItems)) {
|
|
4456
4456
|
return data.sectionDataBindingItems.map((item) => item.data).filter(Boolean);
|
|
4457
4457
|
}
|
|
4458
4458
|
return [];
|
|
4459
4459
|
}, [data]);
|
|
4460
|
-
require$$0.useEffect(() => {
|
|
4461
|
-
if (faqs.length > 0) {
|
|
4462
|
-
setActiveIndex(0);
|
|
4463
|
-
}
|
|
4464
|
-
}, [faqs]);
|
|
4465
4460
|
const toggleFaq = (index2) => {
|
|
4466
4461
|
setActiveIndex(activeIndex === index2 ? -1 : index2);
|
|
4467
4462
|
};
|