import React from 'react';
import { connect } from 'react-redux';
import { Tooltip } from '@easyv/react-gui';
import { addPanel } from 'models/panel';
import styles from './index.less';

function Panel({ dispatch, type }) {
  return (
    <Tooltip title={type === 1 ? '引用面板' : '动态面板'} placement="left">
      <div className={styles.item} onClick={() => dispatch(addPanel(type))}>
        <i className={`icon iconfont ${type === 1 ? 'icon-icon_link' : 'icon-btn_panel'}`} />
      </div>
    </Tooltip>
  );
}

export default connect()(Panel);
