mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-20 23:35:51 +00:00
32 lines
881 B
TypeScript
32 lines
881 B
TypeScript
import * as React from 'react';
|
|
import { Box, Text, stringWidth } from '@anthropic/ink';
|
|
import TextInput from '../TextInput.js';
|
|
|
|
type Props = {
|
|
value: string;
|
|
onChange: (value: string) => void;
|
|
historyFailedMatch: boolean;
|
|
};
|
|
|
|
function HistorySearchInput({ value, onChange, historyFailedMatch }: Props): React.ReactNode {
|
|
return (
|
|
<Box gap={1}>
|
|
<Text dimColor>{historyFailedMatch ? 'no matching prompt:' : 'search prompts:'}</Text>
|
|
<TextInput
|
|
value={value}
|
|
onChange={onChange}
|
|
// Force cursor to end of search input since navigation should cancel search
|
|
cursorOffset={value.length}
|
|
onChangeCursorOffset={() => {}}
|
|
columns={stringWidth(value) + 1}
|
|
focus={true}
|
|
showCursor={true}
|
|
multiline={false}
|
|
dimColor={true}
|
|
/>
|
|
</Box>
|
|
);
|
|
}
|
|
|
|
export default HistorySearchInput;
|