import * as constants from './constants';
import { fromJS } from 'immutable';


const defaultState = fromJS({
	popupsClientId: '',
	companyDetail: { staffDetial: {} },
	loading: true,
	districtOptions: [],
	natureOptions: [
		{ "value": '设计', "label": "设计" }, 
		{ "value": '造价管理', "label": "造价管理" }, 
		{ "value": '业主', "label": "业主" }, 
		{ "value": '交通局', "label": "交通局" }, 
		{ "value": '公路局', "label": "公路局" }, 
		{ "value": '审计', "label": "审计" }, 
		{ "value": '财政', "label": "财政" }, 
		{ "value": '审核', "label": "审核" }, 
		{ "value": '施工', "label": "施工" }, 
		{ "value": '咨询', "label": "咨询" }, 
		{ "value": '招标代理', "label": "招标代理" }, 
		{ "value": '监理', "label": "监理" }, 
		{ "value": '学校', "label": "学校" }, 
		{ "value": '个人', "label": "个人" }, 
		{ "value": '合作伙伴', "label": "合作伙伴" }, 
	],
});

export default (state = defaultState, action) => {

	switch (action.type) {
		case constants.CHANGE_COMPANY_DETAIL:
			return state.merge({
				loading: false,
				companyDetail: fromJS(action.data)
			});
		case constants.CHANGE_COMPANYDETAIL_LOADING:
			return state.set('loading', action.data);
		// 	case constants.SEARCH_BLUR:
		// 		return state.set('focused', false);
		// 	case constants.CHANGE_LIST:
		// 		return state.merge({
		// 			list: action.data,
		// 			totalPage: action.totalPage
		// 		});
		// 	case constants.MOUSE_ENTER:
		// 		return state.set('mouseIn', true);
		// 	case constants.MOUSE_LEAVE:
		// 		return state.set('mouseIn', false);
		// 	case constants.CHANGE_PAGE:
		// 		return state.set('page', action.page);
		default:
			return state;
	}

}