import ActionModel from '../ActionModel'
import { PrankCategoryModalAN, } from '../constants'
import { PrankCategoryModalStateM, } from '../../models/stateModels'
 

const initialState: PrankCategoryModalStateM = {
    isShowModal: false,
}


var reducer = function(state = initialState, action: ActionModel)
{
    let { payload } = action

    switch(action.type)
    {
        case PrankCategoryModalAN.SET_STATE:
            return { ...state, ...payload }

        case PrankCategoryModalAN.TOGGLE_VISIBILITY:
            return { ...state, isShowModal: payload }
    }

    return state
}

export default reducer
