diff --git a/packages/geoview-core/src/core/components/data-table/data-panel.tsx b/packages/geoview-core/src/core/components/data-table/data-panel.tsx index 26728723579..a4ac6ca1efc 100644 --- a/packages/geoview-core/src/core/components/data-table/data-panel.tsx +++ b/packages/geoview-core/src/core/components/data-table/data-panel.tsx @@ -11,6 +11,7 @@ import { useDetailsStoreActions, useDetailsStoreAllFeaturesDataArray, useMapVisibleLayers, + useUIActiveFooterBarTabId, } from '@/core/stores'; import { LayerListEntry, useFooterPanelHeight, Layout } from '../common'; import { logger } from '@/core/utils/logger'; @@ -45,6 +46,7 @@ export function Datapanel({ fullWidth }: DataPanelType) { const visibleLayers = useMapVisibleLayers(); const { setSelectedLayerPath } = useDataTableStoreActions(); const { triggerGetAllFeatureInfo } = useDetailsStoreActions(); + const selectedTab = useUIActiveFooterBarTabId(); // Custom hook for calculating the height of footer panel const { tableHeight } = useFooterPanelHeight({ footerPanelTab: 'data-table' }); @@ -149,19 +151,16 @@ export function Datapanel({ fullWidth }: DataPanelType) { {isLoading && } {!isLoading && - orderedLayerData - .filter(({ features }) => !!features?.length) - .map((data) => ( - - {data.layerPath === selectedLayerPath ? ( - - - - ) : ( - - )} - - ))} + selectedTab === 'data-table' && + orderedLayerData.map((data) => ( + + {data.layerPath === selectedLayerPath ? ( + + ) : ( + + )} + + ))} {/* show data table instructions when all layers has no features */} {((!isLoading && orderedLayerData.every((layers) => !layers?.features?.length)) || isLayerDisabled()) && (