import {
	observer
} from 'mobx-react';
import {
	WeaButtonIcon
} from 'ecCom';

@observer
export default class ButtonIcons extends React.Component {
	constructor(props) {
		super(props);
	}

	render() {
		const {
			store
		} = this.props, {
			buttonIcons,
			delIconState
		} = store;

		return (
			<div className='button-icon'>
				{
					buttonIcons.map((item, index) => {
						const {
							buttonType
						} = item;

						if(buttonType === 'del'){
							return <WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@208p5a@${index}`} {...item} disabled={delIconState}/>
						}else{
							return <WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@dvmmq6@${index}`} {...item} />
						}
					})
				}
			</div>
		);
	}
}