mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-19 18:40:57 -07:00
24 lines
551 B
TypeScript
24 lines
551 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { createContext, useContext } from 'react';
|
|
import type { StartupWarning } from '@google/gemini-cli-core';
|
|
|
|
export interface AppState {
|
|
version: string;
|
|
startupWarnings: StartupWarning[];
|
|
}
|
|
|
|
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;
|
|
};
|