import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import AddSerivce from "./addService.js";
import React, { useRef } from "react";
//#region src/components/ticketBooking/components/addServiceVariant/index.tsx
const AddServiceVariant = (props) => {
	const { globalState, setGlobalState, onPrerenderComplete, onGetProductsReady, productDisplayConfig } = props;
	const stateRef = useRef(globalState);
	stateRef.current = globalState;
	const dispatch = ({ type, payload }) => {
		if (type === "setService") setGlobalState({ service: _objectSpread2(_objectSpread2({}, stateRef.current.service), payload) });
		else if (type === "setPet") setGlobalState({ pet: _objectSpread2(_objectSpread2({}, stateRef.current.pet), payload) });
	};
	return /* @__PURE__ */ React.createElement(AddSerivce, {
		state: globalState,
		dispatch,
		onPrerenderComplete,
		onGetProductsReady,
		productDisplayConfig
	});
};
//#endregion
export { AddServiceVariant as default };
