File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
apify-docs-theme/src/theme Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import LLMButtons from '@theme/LLMButtons';
66import MDXContent from '@theme/MDXContent' ;
77import clsx from 'clsx' ;
88import React from 'react' ;
9+
910import styles from './styles.module.css' ;
1011
1112function useSyntheticTitle ( ) {
Original file line number Diff line number Diff line change 11import React , { useState } from 'react' ;
22
3- import styles from './styles.module.css' ;
4- import { Menu , Text , theme , PlainMenuBaseComponent } from '@apify/ui-library' ;
53import {
4+ ChevronDownIcon ,
65 CopyIcon ,
76 ExternalLinkIcon ,
87 MarkdownIcon ,
9- ChevronDownIcon ,
108} from '@apify/ui-icons' ;
9+ import { Menu , Text , theme } from '@apify/ui-library' ;
10+
11+ import styles from './styles.module.css' ;
12+
13+ function ButtonText ( { isLoading, isCopied } ) {
14+ if ( isLoading ) {
15+ return 'Copying...' ;
16+ }
17+ if ( isCopied ) {
18+ return 'Copied!' ;
19+ }
20+ return 'Copy for LLM' ;
21+ }
1122
1223export default function LLMButtons ( ) {
1324 const [ isCopyingLoading , setCopyingIsLoading ] = useState ( false ) ;
@@ -92,11 +103,7 @@ export default function LLMButtons() {
92103 className = { styles . llmButtonText }
93104 onClick = { onCopyAsMarkdownClick }
94105 >
95- { isCopyingLoading
96- ? 'Copying...'
97- : isCopied
98- ? 'Copied!'
99- : 'Copy for LLM' }
106+ < ButtonText isLoading = { isCopyingLoading } isCopied = { isCopied } />
100107 </ Text >
101108 < ChevronDownIcon
102109 { ...props }
You can’t perform that action at this time.
0 commit comments