import React from 'react'
import styles from './index.less'
import PropTypes from 'prop-types'

class Item extends React.Component {
    handleClick(){
        if(this.props.clazzKey==='gray'){
            return;
        }
        const info={
            day:this.props.value
        };
        this.props.handleClick(info);
    }

    render() {
        return (
            <li className={styles[this.props.clazzKey]} onClick={()=>this.handleClick()}>{this.props.value}</li>
        )
    }
}

export default Item;

Item.propTypes={
    value:PropTypes.number,
    clazzKey:PropTypes.string,
    handleClick:PropTypes.func
};