import React, { PureComponent } from 'react'
import { Button } from 'antd'
import IconUpload from '@/components/CustomUpload'

import Style from './style.less'

export default class extends PureComponent {


  render() {
    const { iconCode, iconName, iconUrl  } = this.props.dataset || {}

    return (
      <div className={Style.navIcon}>
        <div className={Style.icon}>
          <IconUpload onChange={}>
            <img src={iconUrl} />
          </IconUpload>
        </div>
        <div className={Style.label}>{iconName}</div>
        {
          iconUrl && (
            <div className={Style.del}>
              <Button icon="delete" shape="circle" size="sm" onClick={() => this.props.onDelete(this.props.dataset)}></Button>
            </div>
          )
        }
      </div>
    )
  }
}
