From e4658143fa6c0f6dabd528794348b5279055e192 Mon Sep 17 00:00:00 2001 From: duckietm Date: Tue, 19 Mar 2024 09:39:01 +0100 Subject: [PATCH] Fix:Adding Indexing to the Catalog Tabs --- src/components/catalog/CatalogView.tsx | 40 ++++++++++++++------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/components/catalog/CatalogView.tsx b/src/components/catalog/CatalogView.tsx index 6201c33..63cf5af 100644 --- a/src/components/catalog/CatalogView.tsx +++ b/src/components/catalog/CatalogView.tsx @@ -72,24 +72,28 @@ export const CatalogView: FC<{}> = props => setIsVisible(false) } /> - { rootNode && (rootNode.children.length > 0) && rootNode.children.map(child => - { - if(!child.isVisible) return null; - - return ( - - { - if(searchResult) setSearchResult(null); - - activateNode(child); - } } > - - { GetConfiguration('catalog.tab.icons') && } - { child.localization } - - - ); - }) } + {rootNode && + rootNode.children.length > 0 && + rootNode.children.map((child, index) => { + if (!child.isVisible) return null; + // Generate a unique key using the index of the map function + const uniqueKey = `${child.pageId}-${index}`; + return ( + { + if (searchResult) setSearchResult(null); + activateNode(child); + }} + > + + {GetConfiguration('catalog.tab.icons') && } + {child.localization} + + + ); + })}