import cloneDeep from 'lodash/cloneDeep'

const STATE = {}
const NEW_BOARD = {
  name: '',
  description: '',
  width: 1920,
  height: 1080,
  version: 2,
  model: {
    width: 1920,
    height: 1080
  }
}

export default function(state = STATE, action) {
  switch (action.type) {
    case 'NEW-BOARD':
      return cloneDeep(NEW_BOARD)

    case 'SET-CURRENT-BOARD':
      return action.board
        ? {
            ...action.board
          }
        : cloneDeep(NEW_BOARD)

    default:
      return state
  }
}
