import { connect , MapStateToProps , MapDispatchToPropsFunction , } from 'react-redux' ; import Workspace from './index' ; import { StateProps , DispatchProps , OwnProps , } from './props' ; import { getWorkspaceMode , } from 'store/reducers/workspace/settings' ; import { canvasResized , } from 'actions/workspace' ; const mapStateToProps = ( state , { workspaceId } ) => { return { mode : getWorkspaceMode ( state ) ( workspaceId ) , } ; } ; const mapDispatchToProps = ( dispatch , { workspaceId } ) => ( { onResize : ( contentRect ) => dispatch ( canvasResized ( { workspaceId , contentRect } ) ) , } ) ; const ConnectedWorkspace = connect < StateProps , DispatchProps , OwnProps > ( mapStateToProps , mapDispatchToProps ) ( Workspace ) ; export default ConnectedWorkspace ;