import React from 'react';
import { connect } from 'react-redux';
import DiagnosticItem from '@components/DiagnosticItem';
import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList'; 
import {  SHOW_SEARCH,  HIDE_SEARCH, SET_SEARCH_VALUE } from '@store/types/diagnosticSearch';
import { getSearchResult } from '@store/async-actions/diagnosticSearch';
import { isAddMainSuit } from '@store/async-actions/diagnosticList';
import {billing, getTips} from '../store/async-actions/pushMessage';


function mapStateToProps(state) {
    return {

    }
}

function mapDispatchToProps(dispatch) {
    return{
        addDiagnostic: (item) => {
            dispatch({
                type: ADD_DIAGNOSTIC,
                item: item
            });
            dispatch({
                type: GET_DIAGNOSTIC_STR
            });
            dispatch(isAddMainSuit())
        },
        showSearch:()=>{
            dispatch({
                type: SHOW_SEARCH
            })
        },
        hideSearch:()=>{
            dispatch({
                type: HIDE_SEARCH
            })
        },
        getTips: (diagItem) => {
            dispatch(getTips(diagItem))
        }
    }
}

const DiagnosticItemContainer = connect(
    mapStateToProps,
    mapDispatchToProps
)(DiagnosticItem);

export default DiagnosticItemContainer;