// @flow import React, { Component } from 'react'; import { observer, inject } from 'mobx-react'; import CenteredContent from 'components/CenteredContent'; import { ListPlaceholder } from 'components/LoadingPlaceholder'; import Empty from 'components/Empty'; import PageTitle from 'components/PageTitle'; import DocumentList from 'components/DocumentList'; import DocumentsStore from 'stores/DocumentsStore'; @observer class Drafts extends Component { props: { documents: DocumentsStore, }; componentDidMount() { this.props.documents.fetchDrafts(); } render() { const { isLoaded, isFetching, drafts } = this.props.documents; const showLoading = !isLoaded && isFetching; const showEmpty = isLoaded && !drafts.length; return (

Drafts

{showLoading && } {showEmpty && No drafts yet.}
); } } export default inject('documents')(Drafts);