Skip to content

Commit 6c0a24d

Browse files
committed
Remove disabled copy button state
- Simplify `MessageCopyButton` to always be enabled - Keep copy feedback limited to the copied state
1 parent 0d4beff commit 6c0a24d

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

apps/web/src/components/chat/MessageCopyButton.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { cn } from "~/lib/utils";
77
export const MessageCopyButton = memo(function MessageCopyButton({
88
text,
99
title = "Copy message",
10-
disabled = false,
11-
disabledTitle,
1210
size = "xs",
1311
variant = "outline",
1412
className,
@@ -17,8 +15,6 @@ export const MessageCopyButton = memo(function MessageCopyButton({
1715
}: {
1816
text: string;
1917
title?: string;
20-
disabled?: boolean;
21-
disabledTitle?: string;
2218
size?: "xs" | "icon-xs";
2319
variant?: "outline" | "ghost";
2420
className?: string;
@@ -29,15 +25,14 @@ export const MessageCopyButton = memo(function MessageCopyButton({
2925
...(onCopy ? { onCopy: () => onCopy() } : {}),
3026
...(onError ? { onError: (error: Error) => onError(error) } : {}),
3127
});
32-
const buttonTitle = disabled ? (disabledTitle ?? title) : isCopied ? "Copied" : title;
28+
const buttonTitle = isCopied ? "Copied" : title;
3329

3430
return (
3531
<Button
3632
type="button"
3733
size={size}
3834
variant={variant}
3935
className={cn(className)}
40-
disabled={disabled}
4136
onClick={() => copyToClipboard(text, undefined)}
4237
title={buttonTitle}
4338
aria-label={buttonTitle}

0 commit comments

Comments
 (0)