import React from "react"; import Stack from "react-bootstrap/Stack"; import { Client, IAccount } from "./types"; type MailboxListProps = { account: IAccount | null; client: Client | null }; type MailboxListState = {}; class MailboxList extends React.Component { componentDidMount() { if (this.props.account == null) return; if (this.props.client == null) return; const args = { accountId: this.props.account.id, ids: [], }; this.props.client .mailbox_get(args) .then(() => { console.log("got mailboxen"); }) .catch(() => { console.error("Failed to get mailboxes"); }); } render() { return this.props.account == null ? ( ) : ( {this.props.account.mailboxes.map((m) => (
  • {m.name}
  • ))}
    ); } } export default MailboxList;