@@ -3,13 +3,14 @@ import React from 'react';
33import { isNil } from 'lodash' ;
44
55import { ResponseError } from '../../../components/Errors/ResponseError' ;
6- import type { Column } from '../../../components/PaginatedTable' ;
6+ import type { PaginatedTableData } from '../../../components/PaginatedTable' ;
77import { PaginatedTableWithLayout } from '../../../components/PaginatedTable/PaginatedTableWithLayout' ;
88import { TableColumnSetup } from '../../../components/TableColumnSetup/TableColumnSetup' ;
99import { NODES_COLUMNS_TITLES } from '../../../components/nodesColumns/constants' ;
1010import type { NodesColumnId } from '../../../components/nodesColumns/constants' ;
11+ import type { NodesColumn } from '../../../components/nodesColumns/types' ;
1112import { nodesApi } from '../../../store/reducers/nodes/nodes' ;
12- import type { NodesPreparedEntity } from '../../../store/reducers/nodes /types' ;
13+ import type { PreparedStorageNode } from '../../../store/reducers/storage /types' ;
1314import type { NodesGroupByField , NodesPeerRole } from '../../../types/api/nodes' ;
1415import { useAutoRefreshInterval } from '../../../utils/hooks' ;
1516import { useSelectedColumns } from '../../../utils/hooks/useSelectedColumns' ;
@@ -32,9 +33,10 @@ interface NodeGroupProps {
3233 searchValue : string ;
3334 peerRoleFilter ?: NodesPeerRole ;
3435 groupByParam ?: NodesGroupByField ;
35- columns : Column < NodesPreparedEntity > [ ] ;
36+ columns : NodesColumn [ ] ;
3637 scrollContainerRef : React . RefObject < HTMLElement > ;
3738 onIsExpandedChange : ( name : string , isExpanded : boolean ) => void ;
39+ onDataFetched ?: ( data : PaginatedTableData < PreparedStorageNode > ) => void ;
3840}
3941
4042const NodeGroup = React . memo ( function NodeGroup ( {
@@ -50,6 +52,7 @@ const NodeGroup = React.memo(function NodeGroup({
5052 columns,
5153 scrollContainerRef,
5254 onIsExpandedChange,
55+ onDataFetched,
5356} : NodeGroupProps ) {
5457 return (
5558 < TableGroup
@@ -76,6 +79,7 @@ const NodeGroup = React.memo(function NodeGroup({
7679 initialEntitiesCount = { count }
7780 columns = { columns }
7881 scrollContainerRef = { scrollContainerRef }
82+ onDataFetched = { onDataFetched }
7983 />
8084 }
8185 tableWrapperProps = { {
@@ -92,11 +96,12 @@ interface GroupedNodesComponentProps {
9296 databaseFullPath ?: string ;
9397 scrollContainerRef : React . RefObject < HTMLElement > ;
9498 withPeerRoleFilter ?: boolean ;
95- columns : Column < NodesPreparedEntity > [ ] ;
99+ columns : NodesColumn [ ] ;
96100 defaultColumnsIds : NodesColumnId [ ] ;
97101 requiredColumnsIds : NodesColumnId [ ] ;
98102 selectedColumnsKey : string ;
99103 groupByParams : NodesGroupByField [ ] ;
104+ onDataFetched ?: ( data : PaginatedTableData < PreparedStorageNode > ) => void ;
100105}
101106
102107export function GroupedNodesComponent ( {
@@ -110,6 +115,7 @@ export function GroupedNodesComponent({
110115 requiredColumnsIds,
111116 selectedColumnsKey,
112117 groupByParams,
118+ onDataFetched,
113119} : GroupedNodesComponentProps ) {
114120 const { searchValue, peerRoleFilter, groupByParam} = useNodesPageQueryParams (
115121 groupByParams ,
@@ -147,11 +153,7 @@ export function GroupedNodesComponent({
147153 ) ;
148154
149155 const isLoading = currentData === undefined && isFetching ;
150- const {
151- NodeGroups : tableGroups ,
152- FoundNodes : found = 0 ,
153- TotalNodes : total = 0 ,
154- } = currentData || { } ;
156+ const { tableGroups, found = 0 , total = 0 } = currentData || { } ;
155157
156158 const { expandedGroups, setIsGroupExpanded} = useExpandedGroups ( tableGroups ) ;
157159
@@ -186,6 +188,7 @@ export function GroupedNodesComponent({
186188 columns = { columnsToShow }
187189 scrollContainerRef = { scrollContainerRef }
188190 onIsExpandedChange = { setIsGroupExpanded }
191+ onDataFetched = { onDataFetched }
189192 />
190193 ) ;
191194 } ) ;
0 commit comments