This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
outline/app/components/PaginatedDocumentList.js
Tom Moor 22230c25e5 perf: Use progressive rendering on PaginatedList component (#1156)
* Use progressive rendering on PaginatedList component
Move drafts and starred views to paginated

* heading
2020-01-13 18:17:56 -08:00

37 lines
881 B
JavaScript

// @flow
import * as React from 'react';
import { observer } from 'mobx-react';
import Document from 'models/Document';
import DocumentPreview from 'components/DocumentPreview';
import PaginatedList from 'components/PaginatedList';
type Props = {
documents: Document[],
fetch: (options: ?Object) => Promise<void>,
options?: Object,
heading?: React.Node,
empty?: React.Node,
};
@observer
class PaginatedDocumentList extends React.Component<Props> {
render() {
const { empty, heading, documents, fetch, options, ...rest } = this.props;
return (
<PaginatedList
items={documents}
empty={empty}
heading={heading}
fetch={fetch}
options={options}
renderItem={item => (
<DocumentPreview key={item.id} document={item} {...rest} />
)}
/>
);
}
}
export default PaginatedDocumentList;