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

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

	render() {
		const {
			hrmLevelProtection: store
		} = this.props;

		const {
			table,
			TABLECONFIG,
			cells,
			validator,
			setTableRef
		} = store;

		return (
			<WeaTableEditable ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEditable@ygb6ol`}
				{...toJS(table)}
				{...TABLECONFIG}
				cells={cells}
				validator={validator}
				ref={setTableRef}
			/>
		)
	}
}