summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/InputPrompt.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/components/InputPrompt.tsx')
-rw-r--r--packages/cli/src/ui/components/InputPrompt.tsx39
1 files changed, 39 insertions, 0 deletions
diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx
new file mode 100644
index 00000000..92be10a4
--- /dev/null
+++ b/packages/cli/src/ui/components/InputPrompt.tsx
@@ -0,0 +1,39 @@
+import React from 'react';
+import { Box, Text } from 'ink';
+import TextInput from 'ink-text-input';
+
+interface InputPromptProps {
+ query: string;
+ setQuery: (value: string) => void;
+ onSubmit: (value: string) => void;
+ isActive: boolean;
+}
+
+const InputPrompt: React.FC<InputPromptProps> = ({
+ query,
+ setQuery,
+ onSubmit,
+}) => {
+ return (
+ <Box
+ marginTop={1}
+ borderStyle="round"
+ borderColor={'white'}
+ paddingX={1}
+ >
+ <Text color={'white'}>&gt; </Text>
+ <Box flexGrow={1}>
+ <TextInput
+ value={query}
+ onChange={setQuery}
+ onSubmit={onSubmit}
+ showCursor={true}
+ focus={true}
+ placeholder={'Ask Gemini... (try "/init" or "/help")'}
+ />
+ </Box>
+ </Box>
+ );
+};
+
+export default InputPrompt; \ No newline at end of file