Sha256: 4c62e2d8f50cb92e514c7eb90abfe1cc9f2476c4aa653bbb484fcc556aee9c39
Contents?: true
Size: 751 Bytes
Versions: 848
Compression:
Stored size: 751 Bytes
Contents
import React, { useState } from 'react' import { FileUpload, List, ListItem, } from 'playbook-ui' const AcceptedFilesList = ({ files }) => ( <List> {files.map((file) => ( <ListItem key={file.name}>{file.name}</ListItem> ))} </List> ) const FileUploadAccept = (props) => { const [filesToUpload, setFilesToUpload] = useState([]) const handleOnFilesAccepted = (files) => { setFilesToUpload([...filesToUpload, ...files]) } return ( <div> <AcceptedFilesList files={filesToUpload} {...props} /> <FileUpload accept={['image/svg+xml']} onFilesAccepted={handleOnFilesAccepted} {...props} /> </div> ) } export default FileUploadAccept
Version data entries
848 entries across 848 versions & 2 rubygems