/**
 * Created by mar105 on 2019-03-05.
 */

import { connect } from 'umi';
import CommonNewBillComponent from '../../components/Common/CommonNewBill';

function CommonNewBill({ dispatch, app, content }) {
  const commonNewBillProps = {
    app,
    content,
    dispatch,
    onAddPane: getAddPane, /* 增加标签 */
    onRemovePane: removePane,
  };
  function removePane(changePanes, currentPane) {
    dispatch({ type: 'app/removePane', payload: { changePanes, currentPane } });
  }
  function getAddPane(pane) {
    /* 增加标签 */
    dispatch({ type: 'app/addPane', payload: { pane } });
  }

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

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

