import { connect } from 'umi';
import MaterielComponent from '../../../components/CommonElementEvent/MaterialsInfo';

function Materiel({ dispatch, app, content }) {
  /* const btnData = config.btnData; /!* 工具栏按钮 *!/
    function getFormData(componentName, dataUrl, value, fastbFilter) {
      dispatch({ type: 'mergeTable/getFormData', payload: { componentName, dataUrl, value, fastbFilter } });
    }
    function removePane(changePanes, activeKey) {
      dispatch({ type: 'app/removePane', payload: { changePanes, activeKey } });
    } */
  function removePane(changePanes, currentPane) {
    dispatch({ type: 'app/removePane', payload: { changePanes, currentPane } });
  }

  function removeModalPan(changePanes) {
    dispatch({ type: 'app/removeModalPane', payload: { changePanes } });
  }

  function addPane(pane) {
    dispatch({ type: 'app/addPane', payload: { pane } });
  }
  const materielProps = {
    app,
    content,
    dispatch,
    onAddPane: addPane,
    onRemovePane: removePane,
    onRemoveModalPane: removeModalPan,
  };
  return (
    <MaterielComponent {...materielProps} />
  );
}

export default connect(({ app, content }) =>
  ({ app, content }))(Materiel);
