Spaces:
Runtime error
Runtime error
v26: complete website — Projects live, Sentinel live topology, 4 new components, CF Worker updated, api.js complete
37f231b Download website/src/components/CopyButton.jsx from ghostdrive1/ultron1: direct link, hf CLI and curl.
- Browser
- Download file 547 Bytes
-
https://huggingface.co/spaces/ghostdrive1/ultron1/resolve/main/website/src/components/CopyButton.jsx
- Command line
-
hf download hf://spaces/ghostdrive1/ultron1/website/src/components/CopyButton.jsx
-
curl -L -o CopyButton.jsx https://huggingface.co/spaces/ghostdrive1/ultron1/resolve/main/website/src/components/CopyButton.jsx
547 Bytes
| // website/src/components/CopyButton.jsx | |
| import { useState } from 'react'; | |
| export default function CopyButton({ text, className = '' }) { | |
| const [copied, setCopied] = useState(false); | |
| const copy = async () => { | |
| try { await navigator.clipboard.writeText(text); setCopied(true); setTimeout(() => setCopied(false), 2000); } catch {} | |
| }; | |
| return ( | |
| <button onClick={copy} className={`text-[11px] font-mono text-muted hover:text-ink transition-colors ${className}`} title="Copy"> | |
| {copied ? '✓ copied' : 'copy'} | |
| </button> | |
| ); | |
| } | |