import React, { Component } from 'react';
import PropTypes from 'prop-types';

/**
 *
 *
 * @class CellOperatePanel
 * @extends {Component}
 */
class CellOperatePanel extends Component {
  constructor(props){
    super(props);
    this.state = {

    };
  }
  componentWillMount() {

  }

  componentDidMount(){

  }

  componentWillReceiveProps(nextProps) {

  }

  componentWillUnmount() {

  }

  cloneTemplate = (e) => {
    e.stopPropagation();
    this.props.showEditPanel();
  }

  viewTemplate = (e) => {
    e.stopPropagation();
    this.props.delView();
  }

  render() {
    return (
      <div className='cell-operate-root'>
        <div className='cell-operate-clone' onClick={this.cloneTemplate} >编辑</div>
        <div className='cell-operate-view' onClick={this.viewTemplate} >删除</div>
      </div>
    );
  }
}

CellOperatePanel.propTypes = {
  updateMainView: PropTypes.func,
  device: PropTypes.object,
  delView: PropTypes.func,
  showEditPanel: PropTypes.func
};

export default CellOperatePanel;
