import {
	observer,
} from 'mobx-react';
import { i18n } from '../../../../../public/i18n';

@observer
export default class DateField extends React.Component {
	render() {
		const {
			store
		} = this.props, {
			is_date_selected,
			body_date_style,
			head_bar_datas,
			handleCardItemClick,
		} = store, {
			form_params,
		} = head_bar_datas;

		const content = form_params.content;

		if ( content && content.includes("2")) {
			return (
				<div 
					id="date"
					className={`editor-body-date${is_date_selected ? " selected" : ""}`} 
					style={body_date_style} 
					onClick={e => handleCardItemClick(e, "date")}
				>
					<span>{i18n.label.date()}</span>
				</div>
			)
		}else{
			return null;
		}


	}
}