Sha256: 6625560535397dcf1c68c4f908279457088e6fbbc08162e81509385a74b2cc0a

Contents?: true

Size: 732 Bytes

Versions: 1065

Compression:

Stored size: 732 Bytes

Contents

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

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

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

export default FileUploadDefault

Version data entries

1,065 entries across 1,065 versions & 2 rubygems

Version Path
playbook_ui-7.14.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.13.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.13.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.12.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.12.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx