import { B1tableAreaType } from '@/types'

// 初始化状态
const initState = {
  B1TableListArea: {
    list: [] as B1tableAreaType[],
    total: 0,
    time: ''
  }
}

// 定义 action 类型
type Props = {
  type: 'B1/getListArea'
  payload: { list: B1tableAreaType[]; total: number; time: string }
}

// reducer
export default function Reducer(state = initState, action: Props) {
  switch (action.type) {
    case 'B1/getListArea':
      return { ...state, B1TableListArea: action.payload }
    default:
      return state
  }
}
