Files
buzz/desktop/src/features/agents/ui/CopyButton.tsx
2026-06-15 20:43:49 +01:00

28 lines
526 B
TypeScript

import { Copy } from "lucide-react";
import { toast } from "sonner";
import { Button } from "@/shared/ui/button";
export function CopyButton({
value,
label,
}: {
value: string;
label?: string;
}) {
return (
<Button
onClick={async () => {
await navigator.clipboard.writeText(value);
toast.success("Copied to clipboard");
}}
size="sm"
type="button"
variant="outline"
>
<Copy className="h-4 w-4" />
<span>{label ?? "Copy"}</span>
</Button>
);
}