/**
*
* PluginInputFile
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import cn from 'classnames';
import styles from './styles.scss';
class PluginInputFile extends React.PureComponent {
state = { isDraging: false };
handleClick = (e) => {
e.preventDefault();
e.stopPropagation();
console.log('click');
this.refs.input.click();
}
handleDragEnter = () => this.setState({ isDraging: true });
handleDragLeave = () => this.setState({ isDraging: false });
handleDrop = (e) => {
e.preventDefault();
this.setState({ isDraging: false });
this.props.onDrop(e);
}
render() {
const {
name,
onChange,
} = this.props;
const { isDraging } = this.state;
const link = (
{(message) => {message}}
);
return (
);
}
}
PluginInputFile.defaultProps = {
onChange: () => {},
value: [],
};
PluginInputFile.propTypes = {
name: PropTypes.string.isRequired,
onChange: PropTypes.func,
value: PropTypes.array,
};
export default PluginInputFile;