import React, {
	Component
} from 'react';
import {
	observer
} from 'mobx-react';
import Item from './Item';
import Info from './Info';
import has from 'lodash/has';

@observer
export default class Setting extends Component {
	constructor(props) {
		super(props);
	}

	componentDidMount() {}

	componentWillReceiveProps(nextProps) {}

	render() {
		const {
			store
		} = this.props;
		const {privacySettingList} = store;
		return (
			<div>
			{
				privacySettingList.map((setting, index) => {
					if(has(setting, 'tableProps'))
						return <Item ecId={`${this && this.props && this.props.ecId || ''}_Item@e46m4b@${index}`} store={store} groupSetting={setting} />
					else
						return <Info ecId={`${this && this.props && this.props.ecId || ''}_Info@412i29@${index}`} groupSetting={setting} />
				})
			}
			</div>
		)
	}
}