import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import "./types/index.js";
import React, { createContext, useReducer } from "react";
//#region src/components/walletList/model.tsx
const initialState = {
	list: [],
	balance: null,
	loading: false,
	error: null,
	authError: false,
	hasAttempted: false
};
const Context = createContext({
	state: initialState,
	dispatch: () => null
});
const Provider = (Component) => {
	return function ProviderWrapper(props) {
		const [state, dispatch] = useReducer(reducer, initialState);
		return /* @__PURE__ */ React.createElement(Context.Provider, { value: {
			state,
			dispatch
		} }, /* @__PURE__ */ React.createElement(Component, props));
	};
};
function reducer(state, action) {
	switch (action.type) {
		case "setState": return _objectSpread2(_objectSpread2({}, state), action.payload);
		default: return state;
	}
}
//#endregion
export { Context, Provider };
