import { Upload } from '@btri-ui/base';
import { UploadFile, UploadProps } from 'antd';
import React, { useState } from 'react';
const { Dragger } = Upload;

const App = () => {
  const [fileList, setFileList] = useState<UploadFile[]>([]);

  const handleChange: UploadProps['onChange'] = ({ fileList: newFileList }) =>
    setFileList(newFileList);

  const props = {
    action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
    fileList: fileList,
    onChange: handleChange,
    name: 'file',
    multiple: true,
    onDrop(e) {
      console.log('Dropped files', e.dataTransfer.files);
    },
  };
  return <Dragger {...props}></Dragger>;
};

export default App;
