import { A2dataType } from '@/pages/A2statistics/data'

// 初始化状态
const initState = {
  // 数据
  info: { total: 0, data: [] } as A2dataType
}

// 定义 action 类型
type Props = {
  type: 'A2/getInfo'
  payload: A2dataType
}

// reducer
export default function userReducer(state = initState, action: Props) {
  switch (action.type) {
    // 获取列表数据
    case 'A2/getInfo':
      return { ...state, info: action.payload }

    default:
      return state
  }
}
