// @ts-nocheck
import { connect } from 'react-redux';
import {
  getBillsTableStateFactory,
  billsTableStateChangedFactory,
  getBillsSelectedRowsFactory,
} from '@/store/Bills/bills.selectors';

export const withBills = (mapState) => {
  const getBillsTableState = getBillsTableStateFactory();
  const billsTableStateChanged = billsTableStateChangedFactory();
  const getBillsSelectedRows = getBillsSelectedRowsFactory();

  const mapStateToProps = (state, props) => {
    const mapped = {
      billsTableState: getBillsTableState(state, props),
      billsTableStateChanged: billsTableStateChanged(state, props),
      billsSelectedRows: getBillsSelectedRows(state, props),
    };
    return mapState ? mapState(mapped, state, props) : mapped;
  };
  return connect(mapStateToProps);
};
