import React 			  from 'react';
import {useDropzone}      from 'react-dropzone';
import {actionFullAvatar} from '../actions/actionFullAvatar';
import {connect}          from 'react-redux';
import ConnectedAvaLogo   from '../components/ava';



const Upload = ({onUpload}) => {
	const {acceptedFiles, getRootProps, getInputProps}  = useDropzone();
	let files 											= acceptedFiles.map(file => onUpload(file))
	return (
	    <div {...getRootProps({className: 'dropzone'})} style={{display:'inline'}}>
	       	<input {...getInputProps()} />
	       	<ConnectedAvaLogo style={{width:'100px'}} />  
	    </div> 
	);
}

const ConUpload = connect(null , {onUpload:actionFullAvatar})(Upload)

export default ConUpload;