import { A6QtableType } from "@/types";

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

// 定义 action 类型
type Props = {
  type: "A6Q/getList";
  payload: { list: A6QtableType[]; total: number };
};

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

    default:
      return state;
  }
}
