import React from 'react'; import PropTypes from 'prop-types'; import { Actions } from 'mailspring-exports'; import { RetinaImg } from 'mailspring-component-kit'; import Fields from './fields'; export default class ComposerHeaderActions extends React.Component { static displayName = 'ComposerHeaderActions'; static propTypes = { headerMessageId: PropTypes.string.isRequired, enabledFields: PropTypes.array.isRequired, onShowAndFocusField: PropTypes.func.isRequired, }; _onPopoutComposer = () => { Actions.composePopoutDraft(this.props.headerMessageId); }; render() { const items = []; if (!this.props.enabledFields.includes(Fields.Cc)) { items.push( this.props.onShowAndFocusField(Fields.Cc)} > Cc ); } if (!this.props.enabledFields.includes(Fields.Bcc)) { items.push( this.props.onShowAndFocusField(Fields.Bcc)} > Bcc ); } if (!this.props.enabledFields.includes(Fields.Subject)) { items.push( this.props.onShowAndFocusField(Fields.Subject)} > Subject ); } if (!AppEnv.isComposerWindow()) { items.push( ); } return
{items}
; } }