Sha256: e504bb9f6a0d1652a1ee2e1b4a9cd6a20bec46a2b2bd1676927da4dff8108a31
Contents?: true
Size: 794 Bytes
Versions: 38
Compression:
Stored size: 794 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": [".svg", ".xml"], }} onFilesAccepted={handleOnFilesAccepted} {...props} /> </div> ) } export default FileUploadAccept
Version data entries
38 entries across 38 versions & 2 rubygems