import { A3tableType } from '@/types'

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

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

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

    default:
      return state
  }
}
