2018-02-28 06:41:12 +00:00
|
|
|
|
// @flow
|
2020-06-20 20:59:15 +00:00
|
|
|
|
import * as React from "react";
|
|
|
|
|
import { observer, inject } from "mobx-react";
|
2018-08-07 05:49:41 +00:00
|
|
|
|
|
2020-06-20 20:59:15 +00:00
|
|
|
|
import Heading from "components/Heading";
|
|
|
|
|
import CenteredContent from "components/CenteredContent";
|
|
|
|
|
import Empty from "components/Empty";
|
|
|
|
|
import PageTitle from "components/PageTitle";
|
|
|
|
|
import PaginatedDocumentList from "components/PaginatedDocumentList";
|
|
|
|
|
import Subheading from "components/Subheading";
|
|
|
|
|
import InputSearch from "components/InputSearch";
|
|
|
|
|
import NewDocumentMenu from "menus/NewDocumentMenu";
|
|
|
|
|
import Actions, { Action } from "components/Actions";
|
|
|
|
|
import DocumentsStore from "stores/DocumentsStore";
|
2018-02-28 06:41:12 +00:00
|
|
|
|
|
2018-05-05 23:16:08 +00:00
|
|
|
|
type Props = {
|
|
|
|
|
documents: DocumentsStore,
|
|
|
|
|
};
|
2018-02-28 06:41:12 +00:00
|
|
|
|
|
2018-05-05 23:16:08 +00:00
|
|
|
|
@observer
|
|
|
|
|
class Drafts extends React.Component<Props> {
|
2018-02-28 06:41:12 +00:00
|
|
|
|
render() {
|
2020-01-14 02:17:56 +00:00
|
|
|
|
const { fetchDrafts, drafts } = this.props.documents;
|
2018-02-28 06:41:12 +00:00
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<CenteredContent column auto>
|
|
|
|
|
<PageTitle title="Drafts" />
|
2018-08-07 06:22:20 +00:00
|
|
|
|
<Heading>Drafts</Heading>
|
2020-01-14 02:17:56 +00:00
|
|
|
|
<PaginatedDocumentList
|
|
|
|
|
heading={<Subheading>Documents</Subheading>}
|
|
|
|
|
empty={<Empty>You’ve not got any drafts at the moment.</Empty>}
|
|
|
|
|
fetch={fetchDrafts}
|
|
|
|
|
documents={drafts}
|
|
|
|
|
showDraft={false}
|
|
|
|
|
showCollection
|
|
|
|
|
/>
|
|
|
|
|
|
2018-08-07 05:49:41 +00:00
|
|
|
|
<Actions align="center" justify="flex-end">
|
2020-01-10 03:14:34 +00:00
|
|
|
|
<Action>
|
|
|
|
|
<InputSearch />
|
|
|
|
|
</Action>
|
2018-08-07 05:49:41 +00:00
|
|
|
|
<Action>
|
2019-07-13 17:15:38 +00:00
|
|
|
|
<NewDocumentMenu />
|
2018-08-07 05:49:41 +00:00
|
|
|
|
</Action>
|
|
|
|
|
</Actions>
|
2018-02-28 06:41:12 +00:00
|
|
|
|
</CenteredContent>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-20 20:59:15 +00:00
|
|
|
|
export default inject("documents")(Drafts);
|