mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-14 16:10:59 -07:00
21 lines
507 B
TypeScript
21 lines
507 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import React, { useContext } from 'react';
|
|
import type { LoadedSettings } from '../../config/settings.js';
|
|
|
|
export const SettingsContext = React.createContext<LoadedSettings | undefined>(
|
|
undefined,
|
|
);
|
|
|
|
export const useSettings = () => {
|
|
const context = useContext(SettingsContext);
|
|
if (context === undefined) {
|
|
throw new Error('useSettings must be used within a SettingsProvider');
|
|
}
|
|
return context;
|
|
};
|