import React from 'react'
import {Actions, SendActionsStore} from 'nylas-exports'
import {Menu, RetinaImg, ButtonDropdown, ListensToFluxStore} from 'nylas-component-kit'
class SendActionButton extends React.Component {
static displayName = "SendActionButton";
static containerRequired = false
static propTypes = {
draft: React.PropTypes.object,
isValidDraft: React.PropTypes.func,
sendActions: React.PropTypes.array,
orderedSendActions: React.PropTypes.object,
};
primarySend() {
this._onPrimaryClick();
}
_onPrimaryClick = () => {
const {orderedSendActions} = this.props
const {preferred} = orderedSendActions
this._onSendWithAction(preferred);
}
_onSendWithAction = (sendAction) => {
const {isValidDraft, draft} = this.props
if (isValidDraft()) {
Actions.sendDraft(draft.clientId, sendAction.configKey)
}
}
_renderSendActionItem = ({iconUrl}) => {
let plusHTML = "";
let additionalImg = false;
if (iconUrl) {
plusHTML = + ;
additionalImg = ;
}
return (
Send{plusHTML}{additionalImg}
);
}
_renderSingleButton() {
const {sendActions} = this.props
return (
);
}
_renderButtonDropdown() {
const {orderedSendActions} = this.props
const {preferred, rest} = orderedSendActions
const menu = (