import React from "react"; import Dropzone from 'react-dropzone'; const LIMIT = 10000000; const LIMIT_FILES = 10; export default class FileDropzone extends React.Component { constructor(props) { super(props); this.state = {}; } render() { const { files, onAddFile, onDeleteFile } = this.props; return ( <> { files.length > 0 && (

Приложенные файлы ({ files.length }/{ LIMIT_FILES })

{ files.map((file, index) => (

{ file.size > LIMIT && (Ошибка, превышен допустимый размер файла в 10 мб.) } { file.name } - { parseFloat(file.size / 1000000).toFixed(file.size < 100000 ? 3 : 2) } мб. onDeleteFile(file.name) }>[ удалить ]

)) }
) }

Вы можете приложить до 10 файлов, максимальный размер одного файла: 10 мегабайт.

{ files.length < LIMIT_FILES && ( onAddFile(acceptedFiles) } maxFiles={ LIMIT_FILES }> { ({getRootProps, getInputProps}) => (

Перенесите файлы на экран для быстрой загрузки или выберите файл с компьютера

) }
) } ) } }