import { createContext, useContext } from 'react'; import type { PlatformTheme } from '../../../packages/shared/src/contracts/runtime'; import type { AuthUser } from '../../services/authService'; export type PlatformSettingsSection = | 'appearance' | 'account' | 'security' | 'devices' | 'logs'; type AuthUiContextValue = { user: AuthUser | null; openLoginModal: (postLoginAction?: (() => void) | null) => void; requireAuth: (action: () => void) => void; openSettingsModal: (section?: PlatformSettingsSection) => void; openAccountModal: () => void; logout: () => Promise; setGlobalAccountActionsVisible: (visible: boolean) => void; musicVolume: number; setMusicVolume: (value: number) => void; platformTheme: PlatformTheme; setPlatformTheme: (theme: PlatformTheme) => void; isHydratingSettings: boolean; isPersistingSettings: boolean; settingsError: string | null; }; export const AuthUiContext = createContext(null); export function useAuthUi() { return useContext(AuthUiContext); }