import { createContext, useContext } from 'react';
import type { BotState } from '../hooks/useWebSocket';
import type { Socket } from 'socket.io-client';

export interface AppContextValue {
  botState: BotState;
  socket: Socket | null;
  connected: boolean;
  activeSymbol: string;
  setActiveSymbol: (symbol: string) => void;
  isAdmin: boolean;
  user: any;
  profile: any;
  showBacktestTab: boolean;
  showMarketplaceTab: boolean;
  handleSignOut: () => void;
}

export const AppContext = createContext<AppContextValue>({} as AppContextValue);
export const useAppContext = () => useContext(AppContext);
