import React, {Component, PropTypes} from 'react'; import {RetinaImg, Flexbox, EditableList} from 'nylas-component-kit'; import {Account} from 'nylas-exports'; import classnames from 'classnames'; 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 (
) } } _renderAccount = (account)=> { const label = account.label; const accountSub = `${account.name || 'No name provided'} <${account.emailAddress}>`; const syncError = account.syncState !== Account.SYNC_STATE_RUNNING; return (
{label}
{accountSub} ({account.displayProvider()})
); }; render() { if (!this.props.accounts) { return
; } return (
); } } export default PreferencesAccountList;