import React from "react"; import Stack from "react-bootstrap/Stack"; import Client from "./client/Client"; import { IAccount, IMailbox } from "./client/types"; type EmailListProps = { account: IAccount | null; client: Client | null; mailbox: IMailbox | null; }; type EmailListState = {}; class EmailList extends React.Component { componentDidUpdate() { if (this.props.account == null) return; if (this.props.client == null) return; if (this.props.mailbox == null) return; this.props.client.emailList( this.props.account.id, this.props.mailbox.id, [], ); } render() { return !(this.props.account && this.props.mailbox) ? ( ) : ( {this.props.mailbox.emails.map((m) => (
{m.subject}
))}
); } } export default EmailList;