feat: add copy button api key
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Copy } from "lucide-react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export function CopyButton({
|
||||
className,
|
||||
@@ -13,7 +14,9 @@ export function CopyButton({
|
||||
}) {
|
||||
return (
|
||||
<Button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
toast.success("Copied to clipboard");
|
||||
navigator.clipboard.writeText(props.text);
|
||||
}}
|
||||
className={cn(" p-2 min-h-0 aspect-square", className)}
|
||||
|
||||
Reference in New Issue
Block a user