mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-13 07:30:52 -07:00
19 lines
475 B
TypeScript
19 lines
475 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import React, { useContext } from 'react';
|
|
import { type Config } from '@google/gemini-cli-core';
|
|
|
|
export const ConfigContext = React.createContext<Config | undefined>(undefined);
|
|
|
|
export const useConfig = () => {
|
|
const context = useContext(ConfigContext);
|
|
if (context === undefined) {
|
|
throw new Error('useConfig must be used within a ConfigProvider');
|
|
}
|
|
return context;
|
|
};
|