mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
19 lines
670 B
JavaScript
19 lines
670 B
JavaScript
import { connect } from 'react-redux';
|
|
import { getResourceViews } from 'store/customViews/customViews.selectors';
|
|
import { getExpensesItems } from 'store/expenses/expenses.selectors';
|
|
|
|
export default (mapState) => {
|
|
const mapStateToProps = (state, props) => {
|
|
const mapped = {
|
|
expenses: getExpensesItems(state, state.expenses.currentViewId),
|
|
expensesViews: getResourceViews(state, 'expenses'),
|
|
expensesItems: state.expenses.items,
|
|
expensesTableQuery: state.expenses.tableQuery,
|
|
expensesLoading: state.expenses.loading,
|
|
};
|
|
return mapState ? mapState(mapped, state, props) : mapped;
|
|
};
|
|
|
|
return connect(mapStateToProps);
|
|
};
|