MCPcopy Create free account
hub / github.com/StaticMania/keep-react / CodeBox

Function CodeBox

app/docs/getting-started/colors/CodeBox.tsx:13–34  ·  view source on GitHub ↗
({ color, id, code })

Source from the content-addressed store, hash-verified

11}
12
13const CodeBox: FC<CodeBoxProps> = ({ color, id, code }) => {
14 const { copy, copyToClipboard } = useCopy()
15 return (
16 <div>
17 <button
18 onClick={() => copyToClipboard(code)}
19 className={cn('group flex h-10 w-16 border-spacing-2 items-center justify-center rounded-lg', color)}>
20 <span
21 className={cn(
22 'opacity-0 transition-all duration-300 group-hover:opacity-100',
23 id > 300 ? 'text-metal-100' : 'text-metal-900',
24 )}>
25 {copy ? <Check size={18} /> : <Copy size={18} />}
26 </span>
27 </button>
28 <div className="mt-1 text-left">
29 <p className="text-[10px] font-medium text-metal-600 dark:text-metal-300">{id}</p>
30 <p className="text-[10px] font-medium text-metal-600 dark:text-metal-300">{code}</p>
31 </div>
32 </div>
33 )
34}
35
36export default CodeBox

Callers

nothing calls this directly

Calls 3

cnFunction · 0.90
useCopyFunction · 0.85
copyToClipboardFunction · 0.85

Tested by

no test coverage detected