MCPcopy
hub / github.com/CodebuffAI/codebuff / CopyIcon

Function CopyIcon

cli/src/components/copy-button.tsx:77–98  ·  view source on GitHub ↗
({
  isCopied,
  isHovered,
  leadingSpace,
})

Source from the content-addressed store, hash-verified

75 * Displays a dimmed icon that expands on hover and changes to a checkmark when copied.
76 */
77const CopyIcon: React.FC<CopyIconProps> = ({
78 isCopied,
79 isHovered,
80 leadingSpace,
81}) => {
82 const theme = useTheme()
83 const text = getCopyIconText(isCopied, isHovered, leadingSpace)
84
85 if (isCopied) {
86 return <span fg="green">{text}</span>
87 }
88
89 if (isHovered) {
90 return <span fg={theme.foreground}>{text}</span>
91 }
92
93 return (
94 <span fg={theme.muted} attributes={TextAttributes.DIM}>
95 {text}
96 </span>
97 )
98}
99
100interface CopyButtonProps {
101 /** The text to copy to clipboard when clicked */

Callers

nothing calls this directly

Calls 2

useThemeFunction · 0.90
getCopyIconTextFunction · 0.85

Tested by

no test coverage detected