'use strict'; import React from 'react'; import ProgressBar from 'react-bootstrap/lib/ProgressBar'; import AclProxy from '../../acl_proxy'; import AscribeSpinner from '../../ascribe_spinner'; import { getLangText } from '../../../utils/lang_utils'; const { number, string, func, bool } = React.PropTypes; const FileDragAndDropPreviewImage = React.createClass({ propTypes: { progress: number, url: string, toggleUploadProcess: func, downloadUrl: string, areAssetsDownloadable: bool, showProgress: bool }, getInitialState() { return { paused: true }; }, toggleUploadProcess(e) { e.preventDefault(); e.stopPropagation(); this.setState({ paused: !this.state.paused }); this.props.toggleUploadProcess(); }, render() { const { url, progress, areAssetsDownloadable, downloadUrl, showProgress } = this.props; const imageStyle = { backgroundImage: 'url("' + url + '")', backgroundSize: 'cover' }; let actionSymbol; // only if assets are actually downloadable, there should be a download icon if the process is already at // 100%. If not, no actionSymbol should be displayed if(progress === 100 && areAssetsDownloadable) { actionSymbol =