import { A2NlistType } from '@/pages/A2orderSetNew/type'

// 初始化状态
const initState = {
  // 列表数据
  list: [] as A2NlistType[]
}

// 定义 action 类型
type Props = {
  type: 'A2N/getList'
  payload: A2NlistType[]
}

// reducer
export default function Reducer(state = initState, action: Props) {
  switch (action.type) {
    // 获取列表数据
    case 'A2N/getList':
      return { ...state, list: action.payload }

    default:
      return state
  }
}
