"use client";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { cn } from "@/lib/utils";
import { CheckIcon, CopyIcon } from "@radix-ui/react-icons";
import { useState } from "react";
import { toast } from "sonner";
export const CopyToClipboard = ({ text }: { text: string }) => {
const [copied, setCopied] = useState(false);
const copyToClipboard = async () => {
setCopied(true);
setTimeout(() => {
setCopied(false);
}, 2000);
await navigator.clipboard.writeText(text);
toast("Copied to clipboard", {
icon: