MCPcopy Create free account
hub / github.com/anus-dev/ANUS / DebugProfiler

Function DebugProfiler

packages/cli/src/ui/components/DebugProfiler.tsx:13–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11import { useKeypress } from '../hooks/useKeypress.js';
12
13export const DebugProfiler = () => {
14 const numRenders = useRef(0);
15 const [showNumRenders, setShowNumRenders] = useState(false);
16
17 useEffect(() => {
18 numRenders.current++;
19 });
20
21 useKeypress(
22 (key) => {
23 if (key.ctrl && key.name === 'b') {
24 setShowNumRenders((prev) => !prev);
25 }
26 },
27 { isActive: true },
28 );
29
30 if (!showNumRenders) {
31 return null;
32 }
33
34 return (
35 <Text color={Colors.AccentYellow}>Renders: {numRenders.current} </Text>
36 );
37};

Callers

nothing calls this directly

Calls 1

useKeypressFunction · 0.85

Tested by

no test coverage detected