This commit is contained in:
McPizza
2024-12-04 23:32:55 +00:00
parent 48cb5f6e9b
commit 8b2a866994
3 changed files with 15 additions and 11 deletions
@@ -24,10 +24,8 @@ export const CopyButton = ({
name,
icon = faCopy
}: CopyButtonProps) => {
const tooltipText = name ? `Copy ${name}` : "Copy to clipboard";
const [copyText, isCopying, setCopyText] = useTimedReset<string>({
initialState: tooltipText
initialState: name ? `Copy ${name}` : "Copy to clipboard"
});
async function handleCopyText() {
@@ -39,7 +37,7 @@ export const CopyButton = ({
<div>
<Tooltip content={copyText} size={size === "xs" || size === "sm" ? "sm" : "md"}>
<IconButton
ariaLabel={tooltipText}
ariaLabel={copyText}
variant={variant}
className={twMerge("group relative", color)}
size={size}