mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
35 lines
1.4 KiB
JavaScript
35 lines
1.4 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { getResourceViews } from 'store/customViews/customViews.selectors';
|
|
import {
|
|
getPaymentReceiveCurrentPageFactory,
|
|
getPaymentReceivePaginationMetaFactory,
|
|
getPaymentReceiveTableQuery,
|
|
getPaymentReceivesCurrentViewIdFactory,
|
|
} from 'store/PaymentReceive/paymentReceive.selector';
|
|
|
|
export default (mapState) => {
|
|
const getPyamentReceivesItems = getPaymentReceiveCurrentPageFactory();
|
|
const getPyamentReceivesPaginationMeta = getPaymentReceivePaginationMetaFactory();
|
|
const getPaymentReceivesCurrentViewId = getPaymentReceivesCurrentViewIdFactory();
|
|
|
|
const mapStateToProps = (state, props) => {
|
|
const query = getPaymentReceiveTableQuery(state, props);
|
|
const mapped = {
|
|
PaymentReceivesCurrentPage: getPyamentReceivesItems(state, props, query),
|
|
paymentReceivesViews: getResourceViews(state, props, 'payment_receives'),
|
|
paymentReceivesItems: state.paymentReceives.items,
|
|
paymentReceivesTableQuery: query,
|
|
paymentReceivesPageination: getPyamentReceivesPaginationMeta(
|
|
state,
|
|
props,
|
|
query,
|
|
),
|
|
paymentReceivesLoading: state.paymentReceives.loading,
|
|
paymentReceiveNumberChanged: state.paymentReceives.journalNumberChanged,
|
|
paymentReceivesCurrentViewId: getPaymentReceivesCurrentViewId(state, props),
|
|
};
|
|
return mapState ? mapState(mapped, state, props) : mapped;
|
|
};
|
|
return connect(mapStateToProps);
|
|
};
|