const handleChange = ({ target }) => {
const { files } = target;
const resultFiles = [];
for (const file of files) {
const reader = new FileReader();
const fileName = kebabCase(file.name.split('.')[0]);
reader.onloadend = () => {
resultFiles.push({ fileName, base64: reader.result });
}
reader.readAsDataURL(file);
}
setFiles(resultFiles);
};
export default connect(null, actionCreators)(AddPhotos);