Skip to content

Commit c7b22b4

Browse files
committed
copied icon
1 parent cfc4ba7 commit c7b22b4

File tree

1 file changed

+6
-3
lines changed
  • apify-docs-theme/src/theme/LLMButtons

1 file changed

+6
-3
lines changed

apify-docs-theme/src/theme/LLMButtons/index.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import React, { useCallback, useState } from 'react';
33
import {
44
AnthropicIcon,
55
ChatGptIcon,
6+
CheckIcon,
67
ChevronDownIcon,
78
CopyIcon,
89
ExternalLinkIcon,
10+
LoaderIcon,
911
MarkdownIcon,
1012
PerplexityIcon,
1113
} from '@apify/ui-icons';
@@ -147,11 +149,10 @@ const onCopyAsMarkdownClick = async ({ setCopyingStatus }) => {
147149

148150
// Show success feedback
149151
setCopyingStatus('copied');
150-
setTimeout(() => setCopyingStatus('idle'), 2000);
151152
} catch (error) {
152153
console.error('Failed to copy markdown content:', error);
153154
} finally {
154-
setCopyingStatus('idle');
155+
setTimeout(() => setCopyingStatus('idle'), 2000);
155156
}
156157
};
157158

@@ -198,7 +199,9 @@ const MenuBase = ({
198199
className={styles.copyUpIconWrapper}
199200
onClick={() => onCopyAsMarkdownClick({ setCopyingStatus })}
200201
>
201-
<CopyIcon size={16} />
202+
{copyingStatus === 'loading' && <LoaderIcon size={16} />}
203+
{copyingStatus === 'copied' && <CheckIcon size={16} />}
204+
{copyingStatus === 'idle' && <CopyIcon size={16} />}
202205
</div>
203206
<Text
204207
size="regular"

0 commit comments

Comments
 (0)