import { A5TableType } from "@/types";

// 初始化状态
const initState = {
  // 列表数据
  tableList: [] as A5TableType[],
};

// 定义 action 类型
type Props = {
  type: "Section/getList";
  payload: A5TableType[];
};

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