mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
17 lines
569 B
TypeScript
17 lines
569 B
TypeScript
// @ts-nocheck
|
|
import { isAuthenticated } from '@/store/authentication/authentication.reducer';
|
|
import { connect } from 'react-redux';
|
|
|
|
export default (mapState) => {
|
|
const mapStateToProps = (state, props) => {
|
|
const mapped = {
|
|
isAuthorized: isAuthenticated(state),
|
|
authenticatedUserId: state.authentication.userId,
|
|
currentOrganizationId: state.authentication?.organizationId,
|
|
currentTenantId: state.authentication?.tenantId,
|
|
};
|
|
return mapState ? mapState(mapped, state, props) : mapped;
|
|
};
|
|
return connect(mapStateToProps);
|
|
};
|