import Placeholder from "react-bootstrap/Placeholder"; import React from "react"; import Client from "./client/Client"; import DateTime from "./components/DateTime"; import { IAccount, IEmailStub, IMailbox } from "./client/types"; type EmailSummaryProps = { account: IAccount; client: Client; emailId: string; emailStub: IEmailStub | null; mailbox: IMailbox; }; type EmailSummaryState = {}; class EmailSummary extends React.Component< EmailSummaryProps, EmailSummaryState > { componentDidMount() { this.ensureData(); } componentDidUpdate() { this.ensureData(); } ensureData() { this.props.client.ensureEmailStub( this.props.account.id, this.props.emailId, ); } render() { const href = "#" + this.props.account.id + "/" + this.props.mailbox.id + "/" + this.props.emailId; const stub = this.props.emailStub; if (stub === null) { return ; } return (
{" - " + (stub.from == null ? "?" : stub.from[0].name) + " - " + stub.subject}
); } } export default EmailSummary;