import * as React from 'react'

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

    componentDidMount(): void {

    }

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


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

export default GoodsLinkWrapper;