import { UnifiedThemeManager } from '../core/unified-theme-manager'; interface ThemeHook { theme: string; setTheme: (theme: string) => void; toggleTheme: () => void; } // Global theme manager instance let themeManagerInstance: UnifiedThemeManager | null = null; function getThemeManager(): UnifiedThemeManager { if (!themeManagerInstance) { themeManagerInstance = new UnifiedThemeManager(); themeManagerInstance.init(); } return themeManagerInstance; } /** * Universal theme hook */ export function useTheme(): ThemeHook { const themeManager = getThemeManager(); const setTheme = (theme: string): void => { themeManager.apply(theme); }; const toggleTheme = (): void => { themeManager.toggleDarkMode(); }; return { theme: themeManager.getActiveTheme() || 'light', setTheme, toggleTheme }; }