import * as React from "react";

class GroupItem extends React.Component<any, any> {
    constructor(props) {
        super(props);
        this.state = {
            style: {}
        }
    }

    componentDidMount(): void {

    }

    onClick(e) {
        this.props.onSelected ? this.props.onSelected(e) : ''
        // console.log(e,'左侧选中的分组')

    }


    render() {
        return (
            <div className={
                'shop-tab'
                + (this.props.selected ? ' shop-tab-active' : '')
                + (this.props.className ? ' ' + this.props.className : '')
            }
                 onClick={this.onClick.bind(this)}
                 style={this.props.style ? this.props.style : {}}
            >
                <span>{this.props.name}</span>
                {this.props.children}
            </div>
        );
    }
}

export default GroupItem;