mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 15:31:27 +00:00
18 lines
477 B
TypeScript
18 lines
477 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import React, { useContext } from 'react';
|
|
import { type Config } from '@qwen-code/qwen-code-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;
|
|
};
|