mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
14 lines
478 B
JavaScript
14 lines
478 B
JavaScript
import { isAuthenticated } from 'store/authentication/authentication.reducer'
|
|
import { connect } from 'react-redux';
|
|
|
|
export default (mapState) => {
|
|
const mapStateToProps = (state, props) => {
|
|
const mapped = {
|
|
isAuthorized: isAuthenticated(state),
|
|
user: state.authentication.user,
|
|
currentOrganizationId: state.authentication?.organizationId,
|
|
};
|
|
return mapState ? mapState(mapped, state, props) : mapped;
|
|
};
|
|
return connect(mapStateToProps);
|
|
}; |