import { createContext, useContext, useState, type ReactNode } from "react"; interface SymbolContextValue { symbol: string; setSymbol: (s: string) => void; } const SymbolContext = createContext(undefined); const DEFAULT_SYMBOL = "SPY"; export function SymbolProvider({ children }: { children: ReactNode }) { // React state only — per sandbox constraints we never persist to localStorage. const [symbol, setSymbol] = useState(DEFAULT_SYMBOL); return ( {children} ); } export function useSymbol(): SymbolContextValue { const ctx = useContext(SymbolContext); if (!ctx) throw new Error("useSymbol must be used inside SymbolProvider"); return ctx; }