(field: OpenAIField, label: string, opts?: { mask?: boolean })
| 969 | const openaiColumns = useTerminalSize().columns - 20; |
| 970 | |
| 971 | const renderOpenAIRow = (field: OpenAIField, label: string, opts?: { mask?: boolean }) => { |
| 972 | const active = activeField === field; |
| 973 | const val = openaiDisplayValues[field]; |
| 974 | return ( |
| 975 | <Box> |
| 976 | <Text backgroundColor={active ? 'suggestion' : undefined} color={active ? 'inverseText' : undefined}> |
| 977 | {` ${label} `} |
| 978 | </Text> |
| 979 | <Text> </Text> |
| 980 | {active ? ( |
| 981 | <TextInput |
| 982 | value={openaiInputValue} |
| 983 | onChange={setOpenaiInputValue} |
| 984 | onSubmit={handleOpenAIEnter} |
| 985 | cursorOffset={openaiInputCursorOffset} |
| 986 | onChangeCursorOffset={setOpenaiInputCursorOffset} |
| 987 | columns={openaiColumns} |
| 988 | mask={opts?.mask ? '*' : undefined} |
| 989 | focus={true} |
| 990 | /> |
| 991 | ) : val ? ( |
| 992 | <Text color="success"> |
| 993 | {opts?.mask ? val.slice(0, 8) + '\u00b7'.repeat(Math.max(0, val.length - 8)) : val} |
| 994 | </Text> |
| 995 | ) : null} |
| 996 | </Box> |
| 997 | ); |
| 998 | }; |
| 999 | |
| 1000 | return ( |
| 1001 | <Box flexDirection="column" gap={1}> |
no test coverage detected