import { connect } from 'umi';
import KnifeMouldInfoComponent from '../../../components/CommonElementEvent/KnifeMouldInfo';

function KnifemouldInfo({ dispatch, app, content }) {
  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 knifemouldInfoProps = {
    app,
    content,
    dispatch,
    onAddPane: addPane,
    onRemovePane: removePane,
    onRemoveModalPane: removeModalPan,
  };

  return (
    <KnifeMouldInfoComponent {...knifemouldInfoProps} style = {{height:'100%'}}/>
  );
}

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