import { SHOW_SEARCH,  HIDE_SEARCH, SET_SEARCH_VALUE, GET_SEARCH_RESULT } from '../types/diagnosticSearch'; 
import { showSearch,  hideSearch, setSearchValue, getSearchResult } from '../actions/diagnosticSearch'; 

const initState = {
    show: false,
    searchValue: '',
    searchResult: []
}

export default function (state=initState, action) {
    switch(action.type) {
        case SHOW_SEARCH:
            return showSearch(state, action);
        case HIDE_SEARCH: 
            return hideSearch(state, action);
        case SET_SEARCH_VALUE: 
            return setSearchValue(state, action);
        case GET_SEARCH_RESULT: 
            return getSearchResult(state, action);
        default: 
            return state;
    }
}
