import Taro from '@tarojs/taro'
import { View, Image } from '@tarojs/components'

import classNames from 'classnames'
import PropTypes, { InferProps } from 'prop-types'
import CtsComponent from '../../common/component'
import { CtsNoDataTeamProps } from 'types/no-data-team'

let noDataImg = `${Taro['common'].imgUrlTeam}noData.png`

/**
 * 无数据组件
 */
export default class CtsNoDataTeam extends CtsComponent<CtsNoDataTeamProps> {
	// static options = {
  //   addGlobalClass: true
  // }

	public static defaultProps: CtsNoDataTeamProps
  public static propTypes: InferProps<CtsNoDataTeamProps>

  public constructor(props: CtsNoDataTeamProps) {
    super(props)
		this.state = {}
  }

	public render(): JSX.Element {
		const { className, tip } = this.props
		return (
			<View className={classNames('cts-no-data-team', className)}>
				<Image className="img" src={noDataImg} />
				<View className="tip">{tip}</View>
			</View>
		)
	}
}

CtsNoDataTeam.defaultProps = {
  tip: '暂无数据'
}

CtsNoDataTeam.propTypes = {
  tip: PropTypes.string
}
