import { Map, fromJS, List } from 'immutable'
import moment from 'moment'

export function validateState(state = Map({
  phone: { state: 'success', message: '' },
  captcha: { state: 'success', message: '' },
  verifyCode: { state: 'success', message: '' },
  password: { state: 'success', message: '' },
  confirm: { state: 'success', message: '' },
  remember: { state: 'success', message: '' },
}), action) {
  switch (action.type) {
    case 'update':
      return state.sfs(fromJS(action.data))
    default:
      return state
  }
}

export function attributeForm(state = Map(), action) {
  switch (action.type) {
    case 'update':
      return state.sfs(fromJS(action.data))
    default:
      return state
  }
}
