mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
28 lines
821 B
JavaScript
28 lines
821 B
JavaScript
import {connect} from 'react-redux';
|
|
import {
|
|
getResourceViews,
|
|
getViewPages,
|
|
} from 'store/customViews/customViews.selectors'
|
|
import {
|
|
getCurrentPageResults
|
|
} from 'store/selectors';
|
|
|
|
export default (mapState) => {
|
|
const mapStateToProps = (state, props) => {
|
|
const viewPages = getViewPages(state.items.views, state.items.currentViewId);
|
|
const mapped = {
|
|
itemsViews: getResourceViews(state, props, 'items'),
|
|
itemsCurrentPage: getCurrentPageResults(
|
|
state.items.items,
|
|
viewPages,
|
|
state.items.currentPage,
|
|
),
|
|
itemsBulkSelected: state.items.bulkActions,
|
|
itemsTableLoading: state.items.loading,
|
|
itemsTableQuery: state.items.tableQuery,
|
|
};
|
|
return mapState ? mapState(mapped, state, props) : mapped;
|
|
};
|
|
|
|
return connect(mapStateToProps);
|
|
}; |