Skip to content

Commit 9c3bcd0

Browse files
committed
lint fixes
1 parent e02ef01 commit 9c3bcd0

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

apify-docs-theme/src/theme/DocItemContent/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import LLMButtons from '@theme/LLMButtons';
66
import MDXContent from '@theme/MDXContent';
77
import clsx from 'clsx';
88
import React from 'react';
9+
910
import styles from './styles.module.css';
1011

1112
function useSyntheticTitle() {

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
import React, { useState } from 'react';
22

3-
import styles from './styles.module.css';
4-
import { Menu, Text, theme, PlainMenuBaseComponent } from '@apify/ui-library';
53
import {
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

1223
export 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}

0 commit comments

Comments
 (0)