mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
import {connect} from 'react-redux';
|
|
import {
|
|
getResourceViews,
|
|
} from 'store/customViews/customViews.selectors'
|
|
import {
|
|
getItemsCurrentPageFactory,
|
|
getItemsPaginationMetaFactory,
|
|
getItemsTableQueryFactory,
|
|
getItemsCurrentViewIdFactory
|
|
} from 'store/items/items.selectors';
|
|
|
|
export default (mapState) => {
|
|
const getItemsCurrentPage = getItemsCurrentPageFactory();
|
|
const getItemsPaginationMeta = getItemsPaginationMetaFactory();
|
|
const getItemsTableQuery = getItemsTableQueryFactory();
|
|
const getItemsCurrentViewId = getItemsCurrentViewIdFactory();
|
|
|
|
const mapStateToProps = (state, props) => {
|
|
const mapped = {
|
|
itemsViews: getResourceViews(state, props, 'items'),
|
|
itemsCurrentPage: getItemsCurrentPage(state, props),
|
|
itemsBulkSelected: state.items.bulkActions,
|
|
itemsTableLoading: state.items.loading,
|
|
itemsTableQuery: getItemsTableQuery(state, props),
|
|
itemsPagination: getItemsPaginationMeta(state, props),
|
|
itemsCurrentViewId: getItemsCurrentViewId(state, props),
|
|
};
|
|
return mapState ? mapState(mapped, state, props) : mapped;
|
|
};
|
|
|
|
return connect(mapStateToProps);
|
|
}; |