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

import settings from 'store/settings';
import Detail, { StateProps, DispatchProps, OwnProps } from './Detail';

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

const mapDispatchToProps = {
  loadData: settings.actions.loadOne.request.action,
};

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

export default Wrapped;
