mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
fix errors
This commit is contained in:
@@ -8,7 +8,8 @@ import type React from 'react';
|
|||||||
import { Box, Text } from 'ink';
|
import { Box, Text } from 'ink';
|
||||||
import type { RegistryExtension } from '../../../config/extensionRegistryClient.js';
|
import type { RegistryExtension } from '../../../config/extensionRegistryClient.js';
|
||||||
import { useKeypress } from '../../hooks/useKeypress.js';
|
import { useKeypress } from '../../hooks/useKeypress.js';
|
||||||
import { keyMatchers, Command } from '../../keyMatchers.js';
|
import { Command } from '../../key/keyMatchers.js';
|
||||||
|
import { useKeyMatchers } from '../../hooks/useKeyMatchers.js';
|
||||||
import { theme } from '../../semantic-colors.js';
|
import { theme } from '../../semantic-colors.js';
|
||||||
|
|
||||||
export interface ExtensionDetailsProps {
|
export interface ExtensionDetailsProps {
|
||||||
@@ -28,6 +29,7 @@ export function ExtensionDetails({
|
|||||||
onInstall,
|
onInstall,
|
||||||
isInstalled,
|
isInstalled,
|
||||||
}: ExtensionDetailsProps): React.JSX.Element {
|
}: ExtensionDetailsProps): React.JSX.Element {
|
||||||
|
const keyMatchers = useKeyMatchers();
|
||||||
const [consentRequest, setConsentRequest] = useState<{
|
const [consentRequest, setConsentRequest] = useState<{
|
||||||
prompt: string;
|
prompt: string;
|
||||||
resolve: (value: boolean) => void;
|
resolve: (value: boolean) => void;
|
||||||
@@ -57,9 +59,12 @@ export function ExtensionDetails({
|
|||||||
}
|
}
|
||||||
if (keyMatchers[Command.RETURN](key) && !isInstalled && !isInstalling) {
|
if (keyMatchers[Command.RETURN](key) && !isInstalled && !isInstalling) {
|
||||||
setIsInstalling(true);
|
setIsInstalling(true);
|
||||||
onInstall((prompt: string) => new Promise((resolve) => {
|
onInstall(
|
||||||
setConsentRequest({ prompt, resolve });
|
(prompt: string) =>
|
||||||
}));
|
new Promise((resolve) => {
|
||||||
|
setConsentRequest({ prompt, resolve });
|
||||||
|
}),
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import { useRegistrySearch } from '../../hooks/useRegistrySearch.js';
|
|||||||
import { useUIState } from '../../contexts/UIStateContext.js';
|
import { useUIState } from '../../contexts/UIStateContext.js';
|
||||||
import { ExtensionDetails } from './ExtensionDetails.js';
|
import { ExtensionDetails } from './ExtensionDetails.js';
|
||||||
|
|
||||||
interface ExtensionRegistryViewProps {
|
export interface ExtensionRegistryViewProps {
|
||||||
onSelect?: (
|
onSelect?: (
|
||||||
extension: RegistryExtension,
|
extension: RegistryExtension,
|
||||||
requestConsentOverride?: (consent: string) => Promise<boolean>,
|
requestConsentOverride?: (consent: string) => Promise<boolean>,
|
||||||
|
|||||||
Reference in New Issue
Block a user