This commit is contained in:
Timo K
2022-06-11 23:21:20 +02:00
parent dc11814695
commit 18ca92cec4
3 changed files with 44 additions and 10 deletions

View File

@@ -16,10 +16,18 @@ limitations under the License.
import React from "react";
import useClipboard from "react-use-clipboard";
import { ReactComponent as CheckIcon } from "../icons/Check.svg";
import { ReactComponent as CopyIcon } from "../icons/Copy.svg";
import { Button } from "./Button";
interface Props {
value: string;
children: JSX.Element;
className: string;
variant: string;
copiedMessage: string;
}
export function CopyButton({
value,
children,
@@ -27,7 +35,7 @@ export function CopyButton({
variant,
copiedMessage,
...rest
}) {
}: Props) {
const [isCopied, setCopied] = useClipboard(value, { successDuration: 3000 });
return (