import _ from 'underscore'; import React, {Component, PropTypes} from 'react'; import {RetinaImg, MailLabel} from 'nylas-component-kit'; import {SNOOZE_CATEGORY_NAME, PLUGIN_ID} from './snooze-constants'; import {snoozedUntilMessage} from './snooze-utils'; class SnoozeMailLabel extends Component { static displayName = 'SnoozeMailLabel'; static propTypes = { thread: PropTypes.object, }; static containerRequired = false; render() { const {thread} = this.props; if (_.findWhere(thread.categories, {displayName: SNOOZE_CATEGORY_NAME})) { const metadata = thread.metadataForPluginId(PLUGIN_ID); if (metadata) { // TODO this is such a hack const {snoozeDate} = metadata; const message = snoozedUntilMessage(snoozeDate).replace('Snoozed', '') const content = ( {message} ) const label = { displayName: content, isLockedCategory: ()=> true, hue: ()=> 259, } return ; } return } return } } export default SnoozeMailLabel;