import { LogTableType } from '@/pages/Isystem/I8log/data'

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

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

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