import { connect } from 'react-redux';

import paragraph from 'store/paragraph';
import HeaderCms, { HeaderCmsProps } from './HeaderCms';

interface StoreProps {
  logout: Function;
  updateContent: Function;
  globalSearch: Function;
}

const mapStateToProps = (state): Record<string, any> => ({
  search: state.paragraph.search,
});

const mapDispatchToProps = {
  globalSearch: paragraph.actions.search.action,
  logout: paragraph.actions.logout.request.action,
  updateContent: paragraph.actions.updateContent.request.action,
};

const Wrapped = connect(mapStateToProps, mapDispatchToProps)(HeaderCms);

export default Wrapped;
