/**
 * @Date:   2019-05-20T16:45:00+08:00
 * @Last modified time: 2019-06-26T18:40:44+08:00
 */

import React from 'react';
import { connect } from 'umi';
// import CommobileBillComponent from '../../../mobile/common/CommobileTabBill';
import CommobileBillComponent from '../../../mobile/common/CommobileSubBill';
import * as commonUtils from '../../../utils/utils';

function commobileBill({
  dispatch, app, content, location,
}) {
  if (location.state === null) {
    return (<div />);
  }
  // const param = commonUtils.convertStrToObj(location.state.sParam);
  let param = {};
  if (location.state.sParam) {
    param = commonUtils.convertStrToObj(location.state.sParam);
  } else {
    param = commonUtils.convertStrToObj(location.state);
  }
  const commonListProps = {
    app,
    content,
    ...param,
    dispatch,
  };
  return (
    <CommobileBillComponent {...commonListProps} style={{ height: '100%' }} />
  );
}

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