MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / copy

Function copy

graph-ui/src/impact/LocalEvidenceCommand.tsx:6–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4export default function LocalEvidenceCommand({ command, label = 'Copy local command' }: { command: string; label?: string }) {
5 const [result, setResult] = useState<{ command: string; message: string }>();
6 const copy = async () => {
7 try {
8 if (!navigator.clipboard?.writeText) throw new Error('Clipboard unavailable. Select the command below and copy it manually.');
9 await navigator.clipboard.writeText(command);
10 setResult({ command, message: 'Command copied locally. Nothing was executed or sent.' });
11 } catch (error) {
12 setResult({ command, message: error instanceof Error ? error.message : 'Could not copy. Select the command and copy it manually.' });
13 }
14 };
15 return <div className="local-evidence-command">
16 <button type="button" disabled={!command} onClick={() => { void copy(); }}>{label}</button>
17 <code tabIndex={0}>{command}</code>

Callers 1

LocalEvidenceCommandFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected