remove copy copy button from code dropdown (#3317)

This commit is contained in:
Jonathan Dobson
2025-08-29 11:06:38 -04:00
committed by GitHub
parent f8685832ff
commit 410343276d
2 changed files with 25 additions and 21 deletions

View File

@@ -0,0 +1,25 @@
import { useState } from "react";
import { CheckIcon, CopyIcon } from "@radix-ui/react-icons";
import { Button } from "@/components/ui/button";
function CopyButton({ value }: { value: string }) {
const [copied, setCopied] = useState(false);
const handleCopy = () => {
if (copied) {
return;
}
window.navigator.clipboard.writeText(value);
setCopied(true);
setTimeout(() => setCopied(false), 1500);
};
return (
<Button size="icon" variant="ghost" onClick={handleCopy}>
{copied ? <CheckIcon /> : <CopyIcon />}
</Button>
);
}
export { CopyButton };

View File

@@ -1,5 +1,4 @@
import {
CheckIcon,
ChevronDownIcon,
ChevronUpIcon,
CopyIcon,
@@ -33,25 +32,6 @@ import { WorkflowApiResponse } from "../types/workflowTypes";
import { CacheKeyValuesResponse } from "@/routes/workflows/types/scriptTypes";
import { OrgWalled } from "@/components/Orgwalled";
function CopyButton({ value }: { value: string }) {
const [copied, setCopied] = useState(false);
const handleCopy = () => {
if (copied) {
return;
}
window.navigator.clipboard.writeText(value);
setCopied(true);
setTimeout(() => setCopied(false), 1500);
};
return (
<Button size="icon" variant="ghost" onClick={handleCopy}>
{copied ? <CheckIcon /> : <CopyIcon />}
</Button>
);
}
interface Dom {
input: React.MutableRefObject<HTMLInputElement | null>;
}
@@ -202,7 +182,6 @@ function WorkflowHeader({
}}
/>
)}
<CopyButton value={chosenCacheKeyValue ?? ""} />
</div>
</OrgWalled>
)}