mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 20:50:34 +00:00
feat: add mcp dialog
This commit is contained in:
parent
51fdf3c16a
commit
f64f08d8a1
17 changed files with 1453 additions and 9 deletions
31
packages/cli/src/ui/hooks/useMcpDialog.ts
Normal file
31
packages/cli/src/ui/hooks/useMcpDialog.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2025 Qwen
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { useState, useCallback } from 'react';
|
||||
|
||||
export interface UseMcpDialogReturn {
|
||||
isMcpDialogOpen: boolean;
|
||||
openMcpDialog: () => void;
|
||||
closeMcpDialog: () => void;
|
||||
}
|
||||
|
||||
export const useMcpDialog = (): UseMcpDialogReturn => {
|
||||
const [isMcpDialogOpen, setIsMcpDialogOpen] = useState(false);
|
||||
|
||||
const openMcpDialog = useCallback(() => {
|
||||
setIsMcpDialogOpen(true);
|
||||
}, []);
|
||||
|
||||
const closeMcpDialog = useCallback(() => {
|
||||
setIsMcpDialogOpen(false);
|
||||
}, []);
|
||||
|
||||
return {
|
||||
isMcpDialogOpen,
|
||||
openMcpDialog,
|
||||
closeMcpDialog,
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue