import _ from 'lodash';
import classnames from 'classnames';
import React from 'react';
import AddTorrentsDestination from './AddTorrentsDestination';
import LoadingIndicatorDots from '../icons/LoadingIndicatorDots';
import ModalActions from './ModalActions';
import TextboxRepeater from '../forms/TextboxRepeater';
import TorrentActions from '../../actions/TorrentActions';
import UIActions from '../../actions/UIActions';
const METHODS_TO_BIND = [
'handleUrlAdd',
'handleUrlChange',
'handleUrlRemove',
'handleDestinationChange',
'handleAddTorrents'
];
export default class AddTorrents extends React.Component {
constructor() {
super();
this.state = {
addTorrentsError: null,
destination: null,
isAddingTorrents: false,
urlTextboxes: [{value: null}]
};
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}
dismissModal() {
UIActions.dismissModal();
}
onAddTorrentError() {
this.setState({
addTorrentsError: 'There was an error, but I have no idea what happened!',
isAddingTorrents: false
});
}
getActions() {
let icon = null;
let primaryButtonText = 'Add Torrent';
if (this.state.isAddingTorrents) {
icon =