import React, { Component } from 'react'; import { localized } from 'mailspring-exports'; import { RetinaImg, Flexbox, EditableList } from 'mailspring-component-kit'; import classnames from 'classnames'; import PropTypes from 'prop-types'; class PreferencesAccountList extends Component { static propTypes = { accounts: PropTypes.array, selected: PropTypes.object, onAddAccount: PropTypes.func.isRequired, onReorderAccount: PropTypes.func.isRequired, onSelectAccount: PropTypes.func.isRequired, onRemoveAccount: PropTypes.func.isRequired, }; _renderAccountStateIcon(account) { if (account.syncState !== 'running') { return (
); } return null; } _renderAccount = account => { const label = account.label; const accountSub = `${account.name || localized('No name provided')} <${account.emailAddress}>`; const syncError = account.hasSyncStateError(); return (
{label}
{accountSub} ({account.displayProvider()})
); }; render() { if (!this.props.accounts) { return
; } return ( ); } } export default PreferencesAccountList;