88 useReactTable ,
99} from "@tanstack/react-table"
1010import Flex from "src/components/templates/flex"
11+ import { Text } from "src/components/typography"
12+ import { IconComponents , Icon } from "src/components/icon"
1113import { comparison , select , includesString } from "./helpers/filterFns"
1214import useColumns from "./features/useColumns"
1315import makePagination from "./features/pagination"
@@ -172,6 +174,8 @@ const NetdataTable = ({
172174 testPrefix,
173175 } )
174176
177+ const { hasNextPage, loading, warning } = virtualizeOptions
178+
175179 return (
176180 < TableProvider onHoverCell = { onHoverCell } >
177181 < Flex height = "100%" overflow = "hidden" width = "100%" column >
@@ -183,39 +187,53 @@ const NetdataTable = ({
183187 searchValue = { globalFilter }
184188 />
185189 ) : 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 }
189210 enableResize = { enableResize }
190211 disableClickRow = { disableClickRow }
191212 onClickRow = { onClickRow }
192213 testPrefixCallback = { testPrefixCallback }
193214 enableSorting = { enableSorting }
215+ enableColumnPinning = { enableColumnPinning }
194216 table = { table }
195- headers = { table . getLeftFlatHeaders ( ) }
196- testPrefix = { testPrefix }
197217 dataGa = { dataGa }
198- scrollParentRef = { scrollParentRef }
218+ tableRef = { tableRef }
219+ testPrefix = { testPrefix }
199220 virtualizeOptions = { virtualizeOptions }
200221 coloredSortedColumn = { enableSorting && coloredSortedColumn }
222+ { ...rest }
201223 />
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 >
202236 ) }
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- />
219237 </ Flex >
220238 { enablePagination && makePagination ( { table } ) }
221239 </ Flex >
0 commit comments