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

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

		this.datas = [{
			key: "lock",
			icon: "icon-coms-locking",
			name: i18n.label.unlock()
		}, {
			key: "unlock",
			icon: "icon-coms-unlock",
			name: i18n.label.locking() 
		}]
	}

	render() {
		const {
			store
		} = this.props, {
			isLock,
			toggle
		} = store;

		const datas = this.datas;
		const data = isLock ? datas.slice(0, 1) : datas.slice(1);

		return (
			<ul className="anticons-list" onClick={toggle}>
				<li key={data[0].key} title={data[0].name}>
					<i className={data[0].icon} />
					<p>{data[0].name}</p>
				</li>
			</ul>
		);
	}
}