The best way to control Claude Code, Codex and more from any computer or phone

main
ts 13 lines 521 Bytes
Raw
1 import { createContext } from "react";
2
3 // Keep folded text mounted for find; reveal only the selected match.
4 export const MarkdownFindContext = createContext(false);
5
6 /** Create during render with stable `onReveal`; find dispatches `beforematch` to ancestors. */
7 export function findRevealRef(onReveal: () => void) {
8 return (element: HTMLElement | null) => {
9 if (!element) return;
10 element.addEventListener("beforematch", onReveal);
11 return () => element.removeEventListener("beforematch", onReveal);
12 };
13 }