MCPcopy Create free account
hub / github.com/idosal/git-mcp / CopyButton

Function CopyButton

app/chat/components/copy-button.tsx:11–38  ·  view source on GitHub ↗
({ text, className }: CopyButtonProps)

Source from the content-addressed store, hash-verified

9}
10
11export function CopyButton({ text, className }: CopyButtonProps) {
12 const { copied, copy } = useCopy();
13
14 return (
15 <Button
16 variant="ghost"
17 size="sm"
18 className={cn(
19 "transition-opacity opacity-0 group-hover/message:opacity-100 gap-1.5",
20 className,
21 )}
22 onClick={() => copy(text)}
23 title="Copy to clipboard"
24 >
25 {copied ? (
26 <>
27 <CheckIcon className="h-4 w-4" />
28 <span className="text-xs">Copied!</span>
29 </>
30 ) : (
31 <>
32 <CopyIcon className="h-4 w-4" />
33 <span className="text-xs">Copy</span>
34 </>
35 )}
36 </Button>
37 );
38}

Callers

nothing calls this directly

Calls 2

useCopyFunction · 0.90
cnFunction · 0.90

Tested by

no test coverage detected