8
8
useReactTable ,
9
9
} from "@tanstack/react-table"
10
10
import Flex from "src/components/templates/flex"
11
+ import { Text } from "src/components/typography"
12
+ import { IconComponents , Icon } from "src/components/icon"
11
13
import { comparison , select , includesString } from "./helpers/filterFns"
12
14
import useColumns from "./features/useColumns"
13
15
import makePagination from "./features/pagination"
@@ -172,6 +174,8 @@ const NetdataTable = ({
172
174
testPrefix,
173
175
} )
174
176
177
+ const { hasNextPage, loading, warning } = virtualizeOptions
178
+
175
179
return (
176
180
< TableProvider onHoverCell = { onHoverCell } >
177
181
< Flex height = "100%" overflow = "hidden" width = "100%" column >
@@ -183,39 +187,53 @@ const NetdataTable = ({
183
187
searchValue = { globalFilter }
184
188
/>
185
189
) : null }
186
- < Flex ref = { scrollParentRef } overflow = "auto" width = "100%" height = "100%" >
187
- { enableColumnPinning && (
188
- < ColumnPinning
190
+ < Flex column ref = { scrollParentRef } overflow = "auto" width = "100%" height = "100%" >
191
+ < Flex >
192
+ { enableColumnPinning && (
193
+ < ColumnPinning
194
+ enableResize = { enableResize }
195
+ disableClickRow = { disableClickRow }
196
+ onClickRow = { onClickRow }
197
+ testPrefixCallback = { testPrefixCallback }
198
+ enableSorting = { enableSorting }
199
+ table = { table }
200
+ headers = { table . getLeftFlatHeaders ( ) }
201
+ testPrefix = { testPrefix }
202
+ dataGa = { dataGa }
203
+ scrollParentRef = { scrollParentRef }
204
+ virtualizeOptions = { virtualizeOptions }
205
+ coloredSortedColumn = { enableSorting && coloredSortedColumn }
206
+ />
207
+ ) }
208
+ < MainTable
209
+ scrollParentRef = { scrollParentRef }
189
210
enableResize = { enableResize }
190
211
disableClickRow = { disableClickRow }
191
212
onClickRow = { onClickRow }
192
213
testPrefixCallback = { testPrefixCallback }
193
214
enableSorting = { enableSorting }
215
+ enableColumnPinning = { enableColumnPinning }
194
216
table = { table }
195
- headers = { table . getLeftFlatHeaders ( ) }
196
- testPrefix = { testPrefix }
197
217
dataGa = { dataGa }
198
- scrollParentRef = { scrollParentRef }
218
+ tableRef = { tableRef }
219
+ testPrefix = { testPrefix }
199
220
virtualizeOptions = { virtualizeOptions }
200
221
coloredSortedColumn = { enableSorting && coloredSortedColumn }
222
+ { ...rest }
201
223
/>
224
+ </ Flex >
225
+ { ! hasNextPage && ! loading && ! ! warning && (
226
+ < Flex alignItems = "center" justifyContent = "center" gap = { 2 } padding = { [ 4 ] } width = "100%" >
227
+ < Icon name = "warning_triangle_hollow" color = "warning" /> { " " }
228
+ < Text color = "warningText" > { warning } </ Text >
229
+ </ Flex >
230
+ ) }
231
+
232
+ { hasNextPage && loading && (
233
+ < Flex alignItems = "center" justifyContent = "center" gap = { 2 } padding = { [ 4 ] } width = "100%" >
234
+ < IconComponents . LoaderIcon /> < Text > Loading more...</ Text >
235
+ </ Flex >
202
236
) }
203
- < MainTable
204
- scrollParentRef = { scrollParentRef }
205
- enableResize = { enableResize }
206
- disableClickRow = { disableClickRow }
207
- onClickRow = { onClickRow }
208
- testPrefixCallback = { testPrefixCallback }
209
- enableSorting = { enableSorting }
210
- enableColumnPinning = { enableColumnPinning }
211
- table = { table }
212
- dataGa = { dataGa }
213
- tableRef = { tableRef }
214
- testPrefix = { testPrefix }
215
- virtualizeOptions = { virtualizeOptions }
216
- coloredSortedColumn = { enableSorting && coloredSortedColumn }
217
- { ...rest }
218
- />
219
237
</ Flex >
220
238
{ enablePagination && makePagination ( { table } ) }
221
239
</ Flex >
0 commit comments