We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e9f0df commit 24dc227Copy full SHA for 24dc227
site/src/components/ShapeBuilder/index.js
@@ -21,6 +21,21 @@ const ShapeBuilder = () => {
21
const [dragState, setDragState] = useState(null);
22
const [result, setResult] = useState("");
23
24
+ const [error, setError] = useState(null);
25
+ const [showCopied, setShowCopied] = useState(false);
26
+
27
+ const handleCopyToClipboard = async () => {
28
+ if (!result.trim()) return;
29
30
+ try {
31
+ await navigator.clipboard.writeText(result);
32
+ setShowCopied(true);
33
+ setTimeout(() => setShowCopied(false), 2000);
34
+ } catch (err) {
35
+ console.error("Failed to copy to clipboard:", err);
36
+ }
37
+ };
38
39
// deep clone anchors helper
40
const cloneAnchors = (arr) => arr.map(a => ({
41
x: a.x, y: a.y,
0 commit comments