Files
gemini-cli/packages/cli/src/ui/contexts/AppContext.tsx
2025-09-06 05:39:02 +00:00

23 lines
480 B
TypeScript

/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { createContext, useContext } from 'react';
export interface AppState {
version: string;
startupWarnings: string[];
}
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;
};