import React, { createContext, useContext } from "react";
//#region src/components/ticketBooking/context/OsKeyContext.tsx
const OsKeyContext = createContext({ osKey: void 0 });
/**
* OsKey Provider
* 提供 osKey 给子组件使用
*/
const OsKeyProvider = ({ osKey, children }) => {
	return /* @__PURE__ */ React.createElement(OsKeyContext.Provider, { value: { osKey } }, children);
};
/**
* useOsKey Hook
* 在子组件中使用此 hook 获取 osKey
*/
const useOsKey = () => {
	const context = useContext(OsKeyContext);
	if (!context) throw new Error("useOsKey must be used within an OsKeyProvider");
	return (context === null || context === void 0 ? void 0 : context.osKey) || "ticket";
};
//#endregion
export { OsKeyProvider, useOsKey };
