import {
	observer,
} from 'mobx-react';

@observer
export default class Image extends React.Component {
	render() {
		const {
			store
		} = this.props, {
			body_image_style,
			is_image_selected,
			img_datas,
			handleCardItemClick,
		} = store;

		if (!img_datas.id) return null;

		return (
			<div 
				id="img"
				className={`editor-body-img${is_image_selected ? " selected" : ""}`} 
				style={body_image_style}
				onClick={e => handleCardItemClick(e, "img")}
			/>
		);
	}
}