import {
	observer,
} from 'mobx-react';
import {
	WeaTab
} from 'ecCom';

@observer
export default class Tab extends React.Component {
	constructor(props) {
		super(props);
	}

	componentDidMount() {
		const {
			store,
			linkageFieldName,
		} = this.props, {
			share
		} = store;

		share.setSearchlinkageFieldName(linkageFieldName);
	}

	render() {
		const {
			store
		} = this.props, {
			share,
			TAB,
		} = store, {
			SEARCH,
			tab,
			searchsAd,
			searchsBaseValue,
		} = share;

		const staticProps = TAB ? TAB : SEARCH;

		return (
			<WeaTab 
				{...staticProps}
				{...tab}
				searchsAd={searchsAd}
				searchsBaseValue={searchsBaseValue}
			 />
		);
	}
}