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

@observer
export default class ReminderTable extends React.Component {
	render() {
		const {
			store
		} = this.props, {
			remindTypeColumns,
			emailRemindTypeDatas,
			msgRemindTypeDatas,
			handleTableEditChange,
			searchStore,
		} = store, {
			selectedKey
		} = searchStore;

		const datas = (selectedKey === '0') ? toJS(emailRemindTypeDatas) : toJS(msgRemindTypeDatas);

		return (
			<WeaTableEditable ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEditable@vnxjer`} 
				showTitle={false}
				columns={remindTypeColumns} 
				datas={datas}
				getRowSelection={()=>null}
				onChange={handleTableEditChange}
			/>
		);
	}
}