import React from 'react';
import { connect } from 'react-redux';
import HistoryCaseContainer from '@components/HistoryCaseContainer';
import { showHistory,sortHistory,activeHistory } from '@store/actions/historyTemplates'

function mapStateToProps(state) {
    return {
        showHistoryCases:state.historyTemplates.showHistoryCases,
        activeHistory:state.historyTemplates.activeHistory,
        items:state.historyTemplates.items,
    }
}


function mapDispatchToProps(dispatch) {
    return {
        handleTemplateDel(id) {
            dispatch(delItems(id))
        },
        showHistoryBox(){
            dispatch(showHistory(false))
        },
        handleCaseClick(e,val){
            e.stopPropagation();
            dispatch(activeHistory(val))
        },
        handleQuoteClick(e,val){
            e.stopPropagation();
        },
        handleSortClick(){
            dispatch(sortHistory())
        }
    }
}

const HistoryCases = connect(
    mapStateToProps,
    mapDispatchToProps
)(HistoryCaseContainer);
export default HistoryCases;
