import { B1tableType } from '@/pages/B1exhibit/type'

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

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

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

    default:
      return state
  }
}
