MCPcopy Create free account
hub / github.com/triggerdotdev/jsonhero-web / CopySelectedNodeShortcut

Function CopySelectedNodeShortcut

app/components/CopySelectedNode.tsx:4–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { useSelectedInfo } from "../hooks/useSelectedInfo";
3
4export function CopySelectedNodeShortcut() {
5 const selectedInfo = useSelectedInfo();
6
7 useHotkeys(
8 'shift+c,shift+C',
9 (e) => {
10 e.preventDefault();
11 const selectedJSON = selectedInfo?.name === "string"
12 ? selectedInfo?.value
13 : JSON.stringify(selectedInfo?.value, null, 2);
14 navigator.clipboard.writeText(selectedJSON);
15 },
16 [selectedInfo]
17 );
18
19 return <></>;
20}

Callers

nothing calls this directly

Calls 1

useSelectedInfoFunction · 0.90

Tested by

no test coverage detected