-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.tsx
67 lines (64 loc) · 1.87 KB
/
index.tsx
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
61
62
63
64
65
66
67
// InfiniteTable Component
/**
* Component that adds an infinite loader to the BaseTable Componenet
* @packageDocumentation
*/
import React from 'react';
import { TableProps, InfiniteLoader } from 'react-virtualized';
import BaseTable, { SelfProps as BaseTableProps } from './BaseTable';
/** InfiniteTable Props */
type Props = BaseTableProps & TableProps;
/** InfiniteTable Component */
export const InfiniteTable: React.FC<Props> = ({
isRowLoaded,
loadMoreRows,
columns,
width,
height,
rowHeight,
headerHeight,
rowCount,
rowGetter,
rowClassName,
onRowClick,
headerClass,
cellClass,
gridClass,
onRowMouseOver,
onRowMouseOut,
isNextPageLoading,
rowRenderer,
}) => {
return (
<InfiniteLoader
isRowLoaded={isRowLoaded}
loadMoreRows={loadMoreRows}
rowCount={rowCount}
threshold={15}
>
{({ onRowsRendered, registerChild }) => (
<BaseTable
columns={columns}
width={width}
height={height}
rowHeight={rowHeight}
headerHeight={headerHeight}
onRowsRendered={onRowsRendered}
registerChild={registerChild}
rowCount={rowCount}
rowGetter={rowGetter}
rowClassName={rowClassName}
onRowClick={onRowClick}
cellClass={cellClass}
headerClass={headerClass}
gridClass={gridClass}
onRowMouseOver={onRowMouseOver}
onRowMouseOut={onRowMouseOut}
isNextPageLoading={isNextPageLoading}
rowRenderer={rowRenderer}
/>
)}
</InfiniteLoader>
);
};
export default InfiniteTable;