import { Link } from 'react-router'
import { Button, Empty, Flex, Space } from 'antd'
import DataWrap from '@/components/data/DataWrap'
import DataReport from '../components/DataReport'

// 无数据渲染
const EmptyRender = () => {
  return (
    <>
      <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="无数据"></Empty>
      <Flex justify="center" align="middle">
        <Space>
          <Link to="/data/write/copy">
            <Button type="primary">复制数据</Button>
          </Link>
          <Link to="/data/write/upload">
            <Button type="primary">导入数据</Button>
          </Link>
          <Button type="primary" disabled>
            爬取数据
          </Button>
          <Button type="primary" disabled>
            本地数据库连接
          </Button>
          <Button type="primary" disabled>
            API数据获取
          </Button>
        </Space>
      </Flex>
    </>
  )
}

export default function DataWriteMy() {
  return (
    <DataWrap
      title="我的数据集"
      headerRender={(data) => (
        <Flex justify="space-between" align="middle" style={{ marginBottom: '20px' }}>
          <h4>数据集名称：{data.info.name}</h4>
          <DataReport />
        </Flex>
      )}
      empty={<EmptyRender />}></DataWrap>
  )
}
