import { F1exhibitionItemType } from '@/pages/F_exhibition/F1exhibition/types'

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

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

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

    default:
      return state
  }
}
