Sha256: 13e99d9384882e38e584bcc1df25ae5018cfb3d868360503d77584217b12e80d

Contents?: true

Size: 716 Bytes

Versions: 944

Compression:

Stored size: 716 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 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

944 entries across 944 versions & 2 rubygems

Version Path
playbook_ui-14.11.0.pre.rc.17 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.11.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-14.11.0.pre.rc.16 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.11.0.pre.rc.16 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-14.10.0.pre.alpha.play16825301 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.10.0.pre.alpha.play16825301 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-14.11.0.pre.rc.15 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.11.0.pre.rc.15 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-14.11.0.pre.rc.14 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.11.0.pre.rc.14 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-14.11.0.pre.rc.13 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.11.0.pre.rc.13 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-14.11.0.pre.rc.12 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.11.0.pre.rc.12 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5274 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5274 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-14.10.0.pre.alpha.play1465attempt25272 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.10.0.pre.alpha.play1465attempt25272 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-14.10.0.pre.alpha.play16825244 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-14.10.0.pre.alpha.play16825244 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx