MCPcopy Create free account
hub / github.com/coder/coder / CopyPromptButton

Function CopyPromptButton

site/src/pages/TaskPage/TaskTopbar.tsx:111–132  ·  view source on GitHub ↗
({ prompt })

Source from the content-addressed store, hash-verified

109type CopyPromptButtonProps = { prompt: string };
110
111const CopyPromptButton: FC<CopyPromptButtonProps> = ({ prompt }) => {
112 const { copyToClipboard, showCopiedSuccess } = useClipboard();
113 return (
114 <Button
115 disabled={showCopiedSuccess}
116 onClick={() => copyToClipboard(prompt)}
117 size="sm"
118 variant="outline"
119 className="p-0 min-w-0 w-full"
120 >
121 {showCopiedSuccess ? (
122 <>
123 <CheckIcon /> Copied!
124 </>
125 ) : (
126 <>
127 <CopyIcon /> Copy
128 </>
129 )}
130 </Button>
131 );
132};

Callers

nothing calls this directly

Calls 1

useClipboardFunction · 0.90

Tested by

no test coverage detected