import React from 'react'

class LinkWrapper extends React.Component<any, any> {
    constructor(props) {
        super(props);
    }

    componentDidMount(): void {

    }

    goDetail(href) {
        if (this.props.env == 'isMp') {
            this.props.goMpPath(href);
        }else{
            window.location.href = href;
        }
    }


    render() {
        return (
            <div className={this.props.className ? this.props.className : ''}
                 onClick={this.goDetail.bind(this, this.props.link)}
                 style={this.props.style ? this.props.style : {}}
            >
                {this.props.children}
            </div>
        );
    }
}

export default LinkWrapper;