import { UserTableListType } from '@/pages/Isystem/I7user/data'

// 初始化状态
const initState = {
  // 列表数据
  tableInfo: {
    list: [] as UserTableListType[],
    total: 0
  }
}

// 定义 action 类型
type Props = {
  type: 'I7user/getList'
  payload: { list: UserTableListType[]; total: number }
}

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

    default:
      return state
  }
}
