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

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

    componentWillUnmount() {
        this.props.hrmStaffPayrollSummary.resetTab();
    }

    render() {
        const {
            hrmStaffPayrollSummary
        } = this.props, {
            tab,
            setSearchBaseValue,
            handleSearch,
        } = hrmStaffPayrollSummary, {
            searchBaseValue,
        } = tab;

        return (
            <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@fw7git`}
                searchType={['base']}
                searchsBaseValue={ searchBaseValue }
                onSearch={() => handleSearch()}
                onSearchChange={val =>  setSearchBaseValue(val) }
            />
        )

    }
}