import containerConnect from 'Framework/ComponentContainer';
import { setVisible } from 'App/Reducers/UI/Actions';
import { clearOptionDetails } from 'App/Reducers/Configurator/Actions';
import IncompatibilityComponent from '../../Components/Incompatibility';

const mapStateToProps = ({ ui, configurator }) => {
    return {
        Component: IncompatibilityComponent,
        show: !!ui.visibilityMap.incompatibility,
        optionclassifications: configurator.configuration.optionclassifications,
        checkResults: configurator.configuration.check_results,
    };
};

const mapDispatchToProps = dispatch => ({
    onClose: () => {
        dispatch(setVisible('incompatibility', false));
        dispatch(clearOptionDetails());
    },
});

export default containerConnect(mapStateToProps, mapDispatchToProps);
