import { useState } from "react";
import { Copy, Check } from "lucide-react";
import { Button } from "./button";
import { cn } from "../lib/utils";
function CopyButton({
value,
label,
className,
}: {
value: string;
label?: string;
className?: string;
}) {
const [copied, setCopied] = useState(false);
const handleCopy = () => {
void navigator.clipboard.writeText(value).then(() => {
setCopied(true);
setTimeout(() => setCopied(false), 1500);
});
};
if (label) {
return (
);
}
return (
);
}
export { CopyButton };