()
| 2 | import { useSelectedInfo } from "../hooks/useSelectedInfo"; |
| 3 | |
| 4 | export 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 | } |
nothing calls this directly
no test coverage detected