import * as React from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
import { Tabs, Tab } from 'material-ui/Tabs';
import * as EteSync from './api/EteSync';
import JournalEntries from './JournalEntries';
import JournalAddressBook from './JournalAddressBook';
import JournalCalendar from './JournalCalendar';
import LoadingIndicator from './LoadingIndicator';
import { store, StoreState, JournalsData, EntriesType, CredentialsData, fetchEntries } from './store';
interface PropsType {
journals: JournalsData;
etesync: CredentialsData;
match: any;
}
interface PropsTypeInner extends PropsType {
entries: EntriesType;
}
class Journal extends React.Component {
static defaultProps = {
prevUid: null,
};
props: PropsTypeInner;
constructor(props: any) {
super(props);
}
componentDidMount() {
const journal = this.props.match.params.journalUid;
store.dispatch(fetchEntries(this.props.etesync, journal, null));
}
render() {
const journalUid = this.props.match.params.journalUid;
const entries = this.props.entries[journalUid];
if ((!entries) || (entries.value === null)) {
return (