MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / SearchBox

Function SearchBox

source code/components/SearchBox.tsx:16–73  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

14 borderless?: boolean;
15};
16export function SearchBox(t0) {
17 const $ = _c(17);
18 const {
19 query,
20 placeholder: t1,
21 isFocused,
22 isTerminalFocused,
23 prefix: t2,
24 width,
25 cursorOffset,
26 borderless: t3
27 } = t0;
28 const placeholder = t1 === undefined ? "Search\u2026" : t1;
29 const prefix = t2 === undefined ? "\u2315" : t2;
30 const borderless = t3 === undefined ? false : t3;
31 const offset = cursorOffset ?? query.length;
32 const t4 = borderless ? undefined : "round";
33 const t5 = isFocused ? "suggestion" : undefined;
34 const t6 = !isFocused;
35 const t7 = borderless ? 0 : 1;
36 const t8 = !isFocused;
37 let t9;
38 if ($[0] !== isFocused || $[1] !== isTerminalFocused || $[2] !== offset || $[3] !== placeholder || $[4] !== query) {
39 t9 = isFocused ? <>{query ? isTerminalFocused ? <><Text>{query.slice(0, offset)}</Text><Text inverse={true}>{offset < query.length ? query[offset] : " "}</Text>{offset < query.length && <Text>{query.slice(offset + 1)}</Text>}</> : <Text>{query}</Text> : isTerminalFocused ? <><Text inverse={true}>{placeholder.charAt(0)}</Text><Text dimColor={true}>{placeholder.slice(1)}</Text></> : <Text dimColor={true}>{placeholder}</Text>}</> : query ? <Text>{query}</Text> : <Text>{placeholder}</Text>;
40 $[0] = isFocused;
41 $[1] = isTerminalFocused;
42 $[2] = offset;
43 $[3] = placeholder;
44 $[4] = query;
45 $[5] = t9;
46 } else {
47 t9 = $[5];
48 }
49 let t10;
50 if ($[6] !== prefix || $[7] !== t8 || $[8] !== t9) {
51 t10 = <Text dimColor={t8}>{prefix}{" "}{t9}</Text>;
52 $[6] = prefix;
53 $[7] = t8;
54 $[8] = t9;
55 $[9] = t10;
56 } else {
57 t10 = $[9];
58 }
59 let t11;
60 if ($[10] !== t10 || $[11] !== t4 || $[12] !== t5 || $[13] !== t6 || $[14] !== t7 || $[15] !== width) {
61 t11 = <Box flexShrink={0} borderStyle={t4} borderColor={t5} borderDimColor={t6} paddingX={t7} width={width}>{t10}</Box>;
62 $[10] = t10;
63 $[11] = t4;
64 $[12] = t5;
65 $[13] = t6;
66 $[14] = t7;
67 $[15] = width;
68 $[16] = t11;
69 } else {
70 t11 = $[16];
71 }
72 return t11;
73}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected