qwen-code/packages/cli/src/ui/components/InputPrompt.tsx
Taylor Mullen 40e11e053c Fix remaining tslint errors (YAY).
- Also updated ci.yml to ensure that linting failures will break the build.

Fully fixes https://b.corp.google.com/issues/411384603
2025-04-18 19:14:36 -04:00

35 lines
870 B
TypeScript

import React from 'react';
import { Box, Text } from 'ink';
import TextInput from 'ink-text-input';
import { globalConfig } from '../../config/config.js';
interface InputPromptProps {
query: string;
setQuery: (value: string) => void;
onSubmit: (value: string) => void;
isActive: boolean;
}
export const InputPrompt: React.FC<InputPromptProps> = ({
query,
setQuery,
onSubmit,
}) => {
const model = globalConfig.getModel();
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 (${model})... (try "/init" or "/help")`}
/>
</Box>
</Box>
);
};