import { connect } from 'react-redux';
import { StoreState } from 'store/rootReducer';

import blog from 'store/blog';
import List, { StateProps, DispatchProps, OwnProps } from './List';

const mapStateToProps = (state: StoreState): {} => ({
  lg: state.content.lg,
  blog: state.blog,
});

const mapDispatchToProps = {
  loadData: blog.actions.load.request.action,
  deleteItem: blog.actions.delete.request.action,
};

const Wrapped = connect<StateProps, DispatchProps, OwnProps>(
  mapStateToProps,
  mapDispatchToProps,
)(List);

export default Wrapped;
