mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-15 08:31:14 -07:00
32 lines
664 B
TypeScript
32 lines
664 B
TypeScript
|
|
/**
|
||
|
|
* @license
|
||
|
|
* Copyright 2025 Google LLC
|
||
|
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
|
*/
|
||
|
|
|
||
|
|
import { useState, useCallback } from 'react';
|
||
|
|
|
||
|
|
interface UseModelCommandReturn {
|
||
|
|
isModelDialogOpen: boolean;
|
||
|
|
openModelDialog: () => void;
|
||
|
|
closeModelDialog: () => void;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const useModelCommand = (): UseModelCommandReturn => {
|
||
|
|
const [isModelDialogOpen, setIsModelDialogOpen] = useState(false);
|
||
|
|
|
||
|
|
const openModelDialog = useCallback(() => {
|
||
|
|
setIsModelDialogOpen(true);
|
||
|
|
}, []);
|
||
|
|
|
||
|
|
const closeModelDialog = useCallback(() => {
|
||
|
|
setIsModelDialogOpen(false);
|
||
|
|
}, []);
|
||
|
|
|
||
|
|
return {
|
||
|
|
isModelDialogOpen,
|
||
|
|
openModelDialog,
|
||
|
|
closeModelDialog,
|
||
|
|
};
|
||
|
|
};
|