2025-09-06 01:39:02 -04:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { createContext, useContext } from 'react';
|
2026-02-20 13:22:45 -05:00
|
|
|
import type { StartupWarning } from '@google/gemini-cli-core';
|
2025-09-06 01:39:02 -04:00
|
|
|
|
|
|
|
|
export interface AppState {
|
|
|
|
|
version: string;
|
2026-02-20 13:22:45 -05:00
|
|
|
startupWarnings: StartupWarning[];
|
2025-09-06 01:39:02 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const AppContext = createContext<AppState | null>(null);
|
|
|
|
|
|
|
|
|
|
export const useAppContext = () => {
|
|
|
|
|
const context = useContext(AppContext);
|
|
|
|
|
if (!context) {
|
|
|
|
|
throw new Error('useAppContext must be used within an AppProvider');
|
|
|
|
|
}
|
|
|
|
|
return context;
|
|
|
|
|
};
|