MCPcopy Create free account
hub / github.com/continuedev/continue / CopyIconButton

Function CopyIconButton

gui/src/components/gui/CopyIconButton.tsx:13–38  ·  view source on GitHub ↗
({
  text,
  tabIndex,
  checkIconClassName = "h-4 w-4 text-green-400",
  clipboardIconClassName = "h-4 w-4 text-gray-400",
  tooltipPlacement = "bottom",
}: CopyIconButtonProps)

Source from the content-addressed store, hash-verified

11}
12
13export function CopyIconButton({
14 text,
15 tabIndex,
16 checkIconClassName = "h-4 w-4 text-green-400",
17 clipboardIconClassName = "h-4 w-4 text-gray-400",
18 tooltipPlacement = "bottom",
19}: CopyIconButtonProps) {
20 const { copyText, copied } = useCopy(text);
21
22 return (
23 <>
24 <HeaderButtonWithToolTip
25 tooltipPlacement={tooltipPlacement}
26 tabIndex={tabIndex}
27 text={copied ? "Copied" : "Copy"}
28 onClick={copyText}
29 >
30 {copied ? (
31 <CheckIcon className={checkIconClassName} />
32 ) : (
33 <ClipboardIcon className={clipboardIconClassName} />
34 )}
35 </HeaderButtonWithToolTip>
36 </>
37 );
38}

Callers

nothing calls this directly

Calls 1

useCopyFunction · 0.85

Tested by

no test coverage detected