import { connect } from 'dva'
import { Empty } from 'antd'

function EmptyPage (props) {
  const loading = props.loading.effects[props.onEdit ? 'custom/homeboardGetConf' : 'custom/homeboardGetData']
  return (
    <div className='board-page__empty'>
      <Empty
        image={Empty.PRESENTED_IMAGE_SIMPLE}
        description={loading ? '数据加载中，请稍后...' : props.onEdit ? '暂无数据' : <span>暂无数据，请前往配置</span>}
        className='board-page__empty-icon'
      />
    </div>
  )
}

export default connect(({ loading }) => ({ loading }))(EmptyPage)
