Sha256: 70dded1d34fcc92fed3275c282c365e8b2033beb0062abf4bb532c94b05faa66

Contents?: true

Size: 690 Bytes

Versions: 3

Compression:

Stored size: 690 Bytes

Contents

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 FileUploadDefault = () => {
  const [filesToUpload, setFilesToUpload] = useState([])

  const handleOnFilesAccepted = files => {
    setFilesToUpload([...filesToUpload, ...files])
  }

  return (
    <div>
      <AcceptedFilesList files={filesToUpload} />
      <FileUpload
          acceptedFiles={filesToUpload}
          onFilesAccepted={handleOnFilesAccepted}
      />
    </div>
  )
}

export default FileUploadDefault

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-4.10.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx