import React, { createContext, useContext, ReactNode } from 'react'; import { StateLobby } from '../../types'; import { UseGameEventsReturn } from '../hooks/useGameEvents'; export type SocketEventContextType = UseGameEventsReturn; const SocketEventContext = createContext(null); interface SocketEventProviderProps { children: ReactNode; eventHandlers: SocketEventContextType; } export const SocketEventProvider: React.FC = ({ children, eventHandlers }) => { return ( {children} ); }; export const useSocketEventContext = (): SocketEventContextType => { const context = useContext(SocketEventContext); if (!context) { throw new Error('useSocketEventContext must be used within a SocketEventProvider'); } return context; };