import React, {PropTypes} from 'react' import {RetinaImg, Spinner, DraggableImg} from 'nylas-component-kit' import AttachmentComponent from './attachment-component' class ImageAttachmentComponent extends AttachmentComponent { static displayName = 'ImageAttachmentComponent'; static propTypes = { file: PropTypes.object.isRequired, download: PropTypes.object, targetPath: PropTypes.string, }; static containerRequired = false; _canAbortDownload() { return false } _imgOrLoader() { const {download, targetPath} = this.props if (download && download.percent <= 5) { return (
) } else if (download && download.percent < 100) { return ( ) } return } _renderRemoveIcon() { return ( ) } _renderDownloadButton() { return ( ) } render() { const {download, file} = this.props const state = download ? download.state || "" : "" const displayName = file.displayName() return (
{this._renderFileActions()}
{displayName}
{this._imgOrLoader()}
) } } export default ImageAttachmentComponent