import React, {Component, PropTypes} from 'react' import moment from 'moment' import {DateUtils} from 'nylas-exports' import {RetinaImg} from 'nylas-component-kit' import SendLaterActions from './send-later-actions' import {PLUGIN_ID} from './send-later-constants' const {DATE_FORMAT_SHORT} = DateUtils export default class SendLaterStatus extends Component { static displayName = 'SendLaterStatus'; static propTypes = { draft: PropTypes.object, }; onCancelSendLater = ()=> { SendLaterActions.cancelSendLater(this.props.draft.clientId) }; render() { const {draft} = this.props const metadata = draft.metadataForPluginId(PLUGIN_ID) if (metadata && metadata.sendLaterDate) { const {sendLaterDate} = metadata const formatted = DateUtils.format(moment(sendLaterDate), DATE_FORMAT_SHORT) return (