Sha256: 7c629cdcab2eff1ce56343199b9eb4b96d57c310ecbb3e05eb783b0bd19674a3
Contents?: true
Size: 974 Bytes
Versions: 907
Compression:
Stored size: 974 Bytes
Contents
/* eslint-disable react/no-multi-comp */ /* @flow */ import React, { useState } from "react"; import { FileUpload, List, ListItem } from "../.."; const AcceptedFilesList = ({ files }: FileList) => ( <List> {files.map((file) => ( <ListItem key={file.name}>{file.name}</ListItem> ))} </List> ); const FileUploadCustomDescription = (props) => { const [filesToUpload, setFilesToUpload] = useState([]); const handleOnFilesAccepted = (files) => { setFilesToUpload([...filesToUpload, ...files]); }; return ( <div> <AcceptedFilesList files={filesToUpload} {...props} /> <FileUpload accept={['application/pdf','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} acceptedFilesDescription="Adobe (.pdf) and Microsoft (.xslx)" onFilesAccepted={handleOnFilesAccepted} {...props} /> </div> ); }; export default FileUploadCustomDescription;
Version data entries
907 entries across 907 versions & 2 rubygems