(t0)
| 26 | * Fuzzy file finder with a syntax-highlighted preview of the focused file. |
| 27 | */ |
| 28 | export function QuickOpenDialog(t0) { |
| 29 | const $ = _c(35); |
| 30 | const { |
| 31 | onDone, |
| 32 | onInsert |
| 33 | } = t0; |
| 34 | useRegisterOverlay("quick-open"); |
| 35 | const { |
| 36 | columns, |
| 37 | rows |
| 38 | } = useTerminalSize(); |
| 39 | const visibleResults = Math.min(VISIBLE_RESULTS, Math.max(4, rows - 14)); |
| 40 | let t1; |
| 41 | if ($[0] === Symbol.for("react.memo_cache_sentinel")) { |
| 42 | t1 = []; |
| 43 | $[0] = t1; |
| 44 | } else { |
| 45 | t1 = $[0]; |
| 46 | } |
| 47 | const [results, setResults] = useState(t1); |
| 48 | const [query, setQuery] = useState(""); |
| 49 | const [focusedPath, setFocusedPath] = useState(undefined); |
| 50 | const [preview, setPreview] = useState(null); |
| 51 | const queryGenRef = useRef(0); |
| 52 | let t2; |
| 53 | let t3; |
| 54 | if ($[1] === Symbol.for("react.memo_cache_sentinel")) { |
| 55 | t2 = () => () => { |
| 56 | queryGenRef.current = queryGenRef.current + 1; |
| 57 | return void queryGenRef.current; |
| 58 | }; |
| 59 | t3 = []; |
| 60 | $[1] = t2; |
| 61 | $[2] = t3; |
| 62 | } else { |
| 63 | t2 = $[1]; |
| 64 | t3 = $[2]; |
| 65 | } |
| 66 | useEffect(t2, t3); |
| 67 | const previewOnRight = columns >= 120; |
| 68 | const effectivePreviewLines = previewOnRight ? VISIBLE_RESULTS - 1 : PREVIEW_LINES; |
| 69 | let t4; |
| 70 | if ($[3] === Symbol.for("react.memo_cache_sentinel")) { |
| 71 | t4 = q => { |
| 72 | setQuery(q); |
| 73 | const gen = queryGenRef.current = queryGenRef.current + 1; |
| 74 | if (!q.trim()) { |
| 75 | setResults([]); |
| 76 | return; |
| 77 | } |
| 78 | generateFileSuggestions(q, true).then(items => { |
| 79 | if (gen !== queryGenRef.current) { |
| 80 | return; |
| 81 | } |
| 82 | const paths = items.filter(_temp).map(_temp2).filter(_temp3).map(_temp4); |
| 83 | setResults(paths); |
| 84 | }); |
| 85 | }; |
nothing calls this directly
no test coverage detected