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) : ''
    }


    render() {
        return (
            <div className={
                (this.props.flag?'shop-tab ':"m-tabs-con ")
                + (this.props.className ? ' ' + this.props.className : '')
            }
                 onClick={this.onClick.bind(this)}
                 style={{width:this.props.width?'calc(100% / '+ this.props.width+ ')':"100%"}}
            >
                <span className={this.props.selected ?'m-tabs-active':""}>{this.props.name}</span>
                {this.props.children}
            </div>
        );
    }
}

export default GroupItem;