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

import {
	SearchForm
} from '../../public/sweet-form.js';

@inject('hrmAttendanceRpSharingSetting')
@observer
class Tab extends React.Component {
	constructor(props) {
		super(props);
	}

	componentDidMount() {
		this.props.hrmAttendanceRpSharingSetting.getSearchCondition();
	}

	render() {
		const {
			tabProps,
			tab,
			search,
		} = this.props.hrmAttendanceRpSharingSetting, {
			form
		} = search;

		return (
			<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@ek31h8`} 
				{...tabProps} 
				{...tab}
				searchsAd={<div
					onKeyDown={ (e) =>{
                        if (e.keyCode == 13 && e.target.tagName === "INPUT") {
                            this.props.hrmAttendanceRpSharingSetting.handleSearch()
                        }
                    } }
				>{<SearchForm ecId={`${this && this.props && this.props.ecId || ''}_SearchForm@ll9zui`} isFormInit={form.isFormInit} {...search}/>}</div>}
		/>
	);
}
}

export default Tab;