({ color, id, code })
| 11 | } |
| 12 | |
| 13 | const 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 | |
| 36 | export default CodeBox |
nothing calls this directly
no test coverage detected