// 初始化状态应用注解
const initState = {
  // 表格数据
  info1: {
    list: [] as any,
    total: 0,
  },
  // 表格顶部数字数据
  infoNum1: [],
  // 查看和审核的表格信息
  lookInfo: {
    info: {} as any,
    list: [] as any,
  },
  // 点击里面的表格的查看的单个藏品信息
  oneGoodsInfo: {
    info: {},
    fileList: {
      img: [],
      video: [],
      audio: [],
      model: [],
      doc: [],
    },
  } as any,
};

type LoginActionType =
  | { type: "object1/getList"; payload: any }
  | { type: "object1/getListNum"; payload: any }
  | { type: "object1/getLookInfo"; payload: any }
  | { type: "object1/getOneGoodsInfo"; payload: any };
// 频道 reducer
export default function object1Reducer(
  state = initState,
  action: LoginActionType
) {
  switch (action.type) {
    // 表格数据1
    case "object1/getList":
      return { ...state, info1: action.payload };
    // 表格顶部数字数据1
    case "object1/getListNum":
      return { ...state, infoNum1: action.payload };
    // 查看和审核的表格数据
    case "object1/getLookInfo":
      return { ...state, lookInfo: action.payload };
    // 点击里面的表格的查看的单个藏品信息
    case "object1/getOneGoodsInfo":
      return { ...state, oneGoodsInfo: action.payload };

    default:
      return state;
  }
}
