-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathStorageGroupsComponent.tsx
More file actions
60 lines (55 loc) · 2.32 KB
/
StorageGroupsComponent.tsx
File metadata and controls
60 lines (55 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import {PaginatedTableWithLayout} from '../../../components/PaginatedTable/PaginatedTableWithLayout';
import {useStorageGroupsHandlerHasGrouping} from '../../../store/reducers/capabilities/hooks';
import {renderPaginatedTableErrorMessage} from '../../../utils/renderPaginatedTableErrorMessage';
import type {PaginatedStorageProps} from '../PaginatedStorage';
import {PaginatedStorageGroupsTable} from '../PaginatedStorageGroupsTable';
import {useStorageGroupsSelectedColumns} from '../PaginatedStorageGroupsTable/columns/hooks';
import {useStorageQueryParams} from '../useStorageQueryParams';
import {StorageGroupsControlsWithTableState} from './StorageGroupsControls';
export function StorageGroupsComponent({
database,
nodeId,
groupId,
pDiskId,
viewContext,
scrollContainerRef,
initialEntitiesCount,
}: PaginatedStorageProps) {
const {searchValue, visibleEntities, handleShowAllGroups} = useStorageQueryParams();
const storageGroupsHandlerHasGrouping = useStorageGroupsHandlerHasGrouping();
const {columnsToShow, columnsToSelect, setColumns} = useStorageGroupsSelectedColumns({
visibleEntities,
viewContext,
});
return (
<PaginatedTableWithLayout
controls={
<StorageGroupsControlsWithTableState
withTypeSelector
withGroupBySelect={storageGroupsHandlerHasGrouping}
columnsToSelect={columnsToSelect}
handleSelectedColumnsUpdate={setColumns}
/>
}
table={
<PaginatedStorageGroupsTable
database={database}
nodeId={nodeId}
groupId={groupId}
pDiskId={pDiskId}
searchValue={searchValue}
visibleEntities={visibleEntities}
onShowAll={handleShowAllGroups}
scrollContainerRef={scrollContainerRef}
renderErrorMessage={renderPaginatedTableErrorMessage}
columns={columnsToShow}
initialEntitiesCount={initialEntitiesCount}
/>
}
tableWrapperProps={{
scrollContainerRef,
scrollDependencies: [searchValue, visibleEntities],
}}
/>
);
}