Files
buzz/desktop/src/features/agents/ui/CopyButton.tsx
Taylor Ho c48006fc3e fix(profile): consolidate agent profile runtime metadata (#1451)
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f <ab176f059d100602ea25073d9a69ee9817f7b691c76a897180d48498d959faa2@sprout-oss.stage.blox.sqprod.co>
2026-07-02 10:13:15 -07:00

36 lines
783 B
TypeScript

import { Copy } from "lucide-react";
import { copyTextToClipboard } from "@/shared/lib/clipboard";
import { Button, type ButtonProps } from "@/shared/ui/button";
export function CopyButton({
className,
iconOnly = false,
label,
size = "sm",
value,
variant = "outline",
}: {
className?: string;
iconOnly?: boolean;
label?: string;
size?: ButtonProps["size"];
value: string;
variant?: ButtonProps["variant"];
}) {
const resolvedLabel = label ?? "Copy";
return (
<Button
className={className}
onClick={() => copyTextToClipboard(value)}
size={size}
type="button"
variant={variant}
>
<Copy className="h-4 w-4" />
<span className={iconOnly ? "sr-only" : undefined}>{resolvedLabel}</span>
</Button>
);
}