2016-02-19 02:00:11 +08:00
|
|
|
import React, {Component, PropTypes} from 'react'
|
2016-07-29 08:42:14 +08:00
|
|
|
import {DateUtils} from 'nylas-exports'
|
2016-02-19 02:00:11 +08:00
|
|
|
import {Flexbox} from 'nylas-component-kit'
|
|
|
|
import SendingProgressBar from './sending-progress-bar'
|
|
|
|
|
|
|
|
export default class DraftListSendStatus extends Component {
|
|
|
|
static displayName = 'DraftListSendStatus';
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
draft: PropTypes.object,
|
|
|
|
};
|
|
|
|
|
|
|
|
static containerRequired = false;
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const {draft} = this.props
|
|
|
|
if (draft.uploadTaskId) {
|
|
|
|
return (
|
2016-03-18 00:50:30 +08:00
|
|
|
<Flexbox style={{width: 150, whiteSpace: 'nowrap'}}>
|
2016-03-17 10:27:12 +08:00
|
|
|
<SendingProgressBar
|
|
|
|
style={{flex: 1, marginRight: 10}}
|
|
|
|
progress={draft.uploadProgress * 100}
|
|
|
|
/>
|
2016-02-19 02:00:11 +08:00
|
|
|
</Flexbox>
|
|
|
|
)
|
|
|
|
}
|
2016-07-29 08:42:14 +08:00
|
|
|
return <span className="timestamp">{DateUtils.shortTimeString(draft.date)}</span>
|
2016-02-19 02:00:11 +08:00
|
|
|
}
|
|
|
|
}
|