import cloneDeep from 'lodash/cloneDeep'

const STATE = {}
const NEW_MODEL = {
  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_MODEL)

    case 'SET-CURRENT-BOARD':
      return action.board || cloneDeep(NEW_MODEL)

    default:
      return state
  }
}
