mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
23 lines
741 B
TypeScript
23 lines
741 B
TypeScript
// @ts-nocheck
|
|
import { connect } from 'react-redux';
|
|
import {
|
|
getAccountsTableStateFactory,
|
|
accountsTableStateChangedFactory,
|
|
} from '@/store/accounts/accounts.selectors';
|
|
|
|
export const withAccounts = (mapState) => {
|
|
const getAccountsTableState = getAccountsTableStateFactory();
|
|
const accountsTableStateChanged = accountsTableStateChangedFactory();
|
|
|
|
const mapStateToProps = (state, props) => {
|
|
const mapped = {
|
|
accountsTableState: getAccountsTableState(state, props),
|
|
accountsTableStateChanged: accountsTableStateChanged(state, props),
|
|
accountsSelectedRows: state.accounts?.selectedRows || [],
|
|
};
|
|
return mapState ? mapState(mapped, state, props) : mapped;
|
|
};
|
|
|
|
return connect(mapStateToProps);
|
|
};
|