import React from 'react';
import { connect } from 'umi';
import CommonSubBillComponent from '../../components/Common/CommonSubBill';

function CommonSubBill({ dispatch, app, content }) {
  function removePane(changePanes, currentPane) {
    dispatch({ type: 'app/removePane', payload: { changePanes, currentPane } });
  }

  const commonSubBillProps = {
    app,
    content,
    dispatch,
    onRemovePane: removePane,
  };

  return (
    <CommonSubBillComponent {...commonSubBillProps} />
  );
}

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

