/* eslint global-require: 0 */
import { remote } from 'electron';
import { React, PropTypes, Actions, TaskQueue, GetMessageRFC2822Task } from 'mailspring-exports';
import { RetinaImg, ButtonDropdown, Menu } from 'mailspring-component-kit';
export default class MessageControls extends React.Component {
static displayName = 'MessageControls';
static propTypes = {
thread: PropTypes.object.isRequired,
message: PropTypes.object.isRequired,
};
_items() {
const reply = {
name: 'Reply',
image: 'ic-dropdown-reply.png',
select: this._onReply,
};
const replyAll = {
name: 'Reply All',
image: 'ic-dropdown-replyall.png',
select: this._onReplyAll,
};
const forward = {
name: 'Forward',
image: 'ic-dropdown-forward.png',
select: this._onForward,
};
if (!this.props.message.canReplyAll()) {
return [reply, forward];
}
const defaultReplyType = AppEnv.config.get('core.sending.defaultReplyType');
return defaultReplyType === 'reply-all'
? [replyAll, reply, forward]
: [reply, replyAll, forward];
}
_dropdownMenu(items) {
const itemContent = item => (
{item.name}
);
return (