mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
28 lines
966 B
JavaScript
28 lines
966 B
JavaScript
import { connect } from 'react-redux';
|
|
import { getResourceViews } from 'store/customViews/customViews.selectors';
|
|
|
|
import {
|
|
getVendorCurrentPageFactory,
|
|
getVendorsTableQuery,
|
|
getVendorsPaginationMetaFactory,
|
|
} from 'store/vendors/vendors.selectors';
|
|
|
|
export default (mapState) => {
|
|
const getVendorsItems = getVendorCurrentPageFactory();
|
|
const getVendorsPaginationMeta = getVendorsPaginationMetaFactory();
|
|
const mapStateToProps = (state, props) => {
|
|
const query = getVendorsTableQuery(state, props);
|
|
|
|
const mapped = {
|
|
vendorsCurrentPage: getVendorsItems(state, props, query),
|
|
vendorViews: getResourceViews(state, props, 'vendors'),
|
|
vendorItems: state.vendors.items,
|
|
vendorTableQuery: query,
|
|
vendorsPageination: getVendorsPaginationMeta(state, props, query),
|
|
vendorsLoading: state.vendors.loading,
|
|
};
|
|
return mapState ? mapState(mapped, state, props) : mapped;
|
|
};
|
|
return connect(mapStateToProps);
|
|
};
|