Sha256: 2f7da2c6b11517edf689a82671774e02ff9e6e9899b848af66cacff15bf89e4f
Contents?: true
Size: 775 Bytes
Versions: 944
Compression:
Stored size: 775 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 FileUploadCustomMessage = (props) => { const [filesToUpload, setFilesToUpload] = useState([]) const handleOnFilesAccepted = (files) => { setFilesToUpload([...filesToUpload, ...files]) } return ( <div> <AcceptedFilesList files={filesToUpload} {...props} /> <FileUpload customMessage="Playbook is awesome!" onFilesAccepted={handleOnFilesAccepted} {...props} /> </div> ) } export default FileUploadCustomMessage
Version data entries
944 entries across 944 versions & 2 rubygems