import { RECEIVE_FONTS, ADD_FONT, ADD_FONTS } from './Actions';

const initialState = [];

export function fontsReducer(state = initialState, action = {}) {
    switch (action.type) {
        case RECEIVE_FONTS:
            return action.data;
        case ADD_FONT: {
            const customFont = action.data;
            return state.concat(customFont);
        }
        case ADD_FONTS: {
            const customFonts = action.data;
            return state.concat(customFonts);
        }
        default:
            return state;
    }
}

export default fontsReducer;
