import { Button, Upload } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import { FC } from 'react';
import { readExcelFile } from '../../utils/excel';

const DutyTablePage: FC = () => {
  return (
    <Upload
      name='file'
      action=''
      beforeUpload={(file) => {
        let data = readExcelFile(file, 0);
        data
          .then((d) => console.log('read data', d))
          .catch((e) => console.log('got error', e));
        return false;
      }}
    >
      <Button icon={<UploadOutlined />}>上传排班表文件</Button>
    </Upload>
  );
};

export default DutyTablePage;
