MCPcopy Create free account
hub / github.com/amaancoderx/skillui / CopyButton

Function CopyButton

components/CodeBlock.tsx:78–93  ·  view source on GitHub ↗
({ copied, copy }: { copied: boolean; copy: () => void })

Source from the content-addressed store, hash-verified

76}
77
78function CopyButton({ copied, copy }: { copied: boolean; copy: () => void }) {
79 return (
80 <button
81 onClick={copy}
82 className={`flex items-center gap-1.5 px-2 py-1 rounded text-xs font-mono transition-all duration-150
83 ${copied
84 ? 'text-green-600 dark:text-[#28c840]'
85 : 'text-[#bbb] dark:text-[#444] hover:text-[#555] dark:hover:text-[#aaa]'
86 }`}
87 aria-label={copied ? 'Copied' : 'Copy'}
88 >
89 {copied ? <CheckIcon /> : <ClipboardIcon />}
90 <span>{copied ? 'copied' : 'copy'}</span>
91 </button>
92 )
93}
94
95function TerminalBlock({ code, label, className = '' }: { code: string; label?: string; className?: string }) {
96 const { copied, copy } = useCopy(code)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected