import {
    observer,
} from 'mobx-react';
import {Button} from "antd";
import { i18n } from '../../../../public/i18n.js'

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

		this.datas = [{
			key: "save",
			label: i18n.button.save(),
			type: "primary"
		}, {
			key: "preview",
			label: i18n.label.preview(),
			type: "primary"
		}, {
			key: "restoreDefault",
			label: i18n.label.restoreDefault(),
			type: "primary"
		}]
	}
	
	render() {
		const {
			store
		} = this.props, {
			handleHeadButtonClick
		} = store;
		
		return (
			<div className="head-bar-buttons">
				{this.datas.map(data => (
					<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@1migs6@hrm`} type={data.type} onClick={() => handleHeadButtonClick(data.key)}>{data.label}</Button>
				))}
			</div>
		);
	}
}