import classnames from 'classnames';
import Dropzone from 'react-dropzone';
import React from 'react';
import AddTorrentsActions from './AddTorrentsActions';
import AddTorrentsDestination from './AddTorrentsDestination';
import Close from '../icons/Close';
import File from '../icons/File';
import Files from '../icons/Files';
import ModalActions from './ModalActions';
import SettingsStore from '../../stores/SettingsStore';
import TorrentActions from '../../actions/TorrentActions';
const METHODS_TO_BIND = [
'handleAddTorrents',
'handleDestinationChange',
'handleFileDrop',
'handleFileRemove',
'handleStartTorrentsToggle'
];
export default class AddTorrents extends React.Component {
constructor() {
super();
this.state = {
isAddingTorrents: false,
files: null
};
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}
handleFileDrop(files) {
this.setState({files});
}
handleFileRemove(fileIndex) {
let files = this.state.files;
files.splice(fileIndex, 1);
this.setState({files});
}
handleFilesClick(event) {
event.stopPropagation();
}
getModalContent() {
let dropzoneClasses = classnames('form__dropzone dropzone', {
'is-fulfilled': this.state.files && this.state.files.length > 0
});
let dropzoneContent = (