import React, {
	Component
} from 'react';
import {
	observer
} from 'mobx-react';
import {
	WeaSearchGroup,
	WeaTableEditable
} from 'ecCom';
import {
	i18n
} from '../../public/i18n';

@observer
export default class Content extends Component {
	render() {
		const {
			store
		} = this.props;
		const {
			tableConfig,
			setTableRef,
		} = store;
		const searchGroupProps = {
			title: i18n.label.adjustObject(),
			showGroup: true
		}

		return (
			<div className='tableContent'>
				<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@p2tyzn`} {...searchGroupProps}>
					{
						tableConfig.datas.length > 0
						&&
						<div>
							<WeaTableEditable ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEditable@urwc96`} {...tableConfig} ref={dom => {setTableRef(dom)}}/>
						</div>
					}
				</WeaSearchGroup>
			</div>
		)
	}
}