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

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

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

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

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

export default Wrapped;
