import React from "react"; import Stack from "react-bootstrap/Stack"; import Client from "./client/Client"; import { IAccount, IMailbox } from "./client/types"; import EmailSummary from "./EmailSummary"; 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.ensureEmailList( this.props.account.id, this.props.mailbox.id, ); } render() { if ( this.props.account == null || this.props.client == null || this.props.mailbox == null || this.props.mailbox.emailIds == null ) { return ; } else { return ( {this.props.mailbox.emailIds.slice(0, 5).map((e) => ( ))} ); } } } export default EmailList;