import { SET_LAYOUT_MODE } from '../../utils/types'
import { LAYOUT_BLOCKS_PREFIX } from '../../utils/localStorageKeys'

export default {
  [SET_LAYOUT_MODE](state, layout) {
    state.layouts = { ...state.layouts, [layout.block]: layout.layout }
    localStorage.setItem(LAYOUT_BLOCKS_PREFIX, JSON.stringify(state.layouts))
  },
}
