Skip to content

Commit 408ccbb

Browse files
authored
fix: Move LLMButtons component to theme (#1824)
Moves LLMButtons to theme folder to fix docs build in external repos, e.g. https://github.com/apify/apify-sdk-python/actions/runs/17150578935/job/48655702496?pr=561
1 parent be13b70 commit 408ccbb

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

src/components/LLMButtons/CopyForLLM/index.tsx renamed to apify-docs-theme/src/theme/LLMButtons/CopyForLLM/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import React, { useState } from 'react';
1+
import type React from 'react';
2+
import { useState } from 'react';
23

34
import styles from '../styles.module.css';
45

56
// Custom component for button text
67
function ButtonText({ isLoading, isCopied }: { isLoading: boolean; isCopied: boolean }) {
78
if (isLoading) {
8-
return <>Copying...</>;
9+
return 'Copying...';
910
}
1011
if (isCopied) {
11-
return <>Copied!</>;
12+
return 'Copied!';
1213
}
13-
return <>Copy for LLM</>;
14+
return 'Copy for LLM';
1415
}
1516

1617
export default function CopyForLLM() {
File renamed without changes.
File renamed without changes.
File renamed without changes.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import LLMButtons from '@site/src/components/LLMButtons';
21
import Admonition from '@theme/Admonition';
2+
import LLMButtons from '@theme/LLMButtons';
33
import MDXA from '@theme/MDXComponents/A';
44
import MDXCode from '@theme/MDXComponents/Code';
55
import MDXDetails from '@theme/MDXComponents/Details';

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/theme/DocItem/Content/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import { useDoc } from '@docusaurus/plugin-content-docs/client';
22
import { useLocation } from '@docusaurus/router';
33
import { ThemeClassNames } from '@docusaurus/theme-common';
44
import Heading from '@theme/Heading';
5+
import LLMButtons from '@theme/LLMButtons';
56
import MDXContent from '@theme/MDXContent';
67
import clsx from 'clsx';
78
import React from 'react';
89

9-
import LLMButtons from '../../../components/LLMButtons';
10-
1110
function useSyntheticTitle() {
1211
const { metadata, frontMatter, contentTitle } = useDoc();
1312
const shouldRender = !frontMatter.hide_title && typeof contentTitle === 'undefined';

tsconfig.eslint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"src/**/*.js",
77
"src/**/*.ts",
88
"src/**/*.jsx",
9-
"src/**/*.tsx"
9+
"src/**/*.tsx",
10+
"apify-docs-theme/**/*.tsx"
1011
]
1112
}

0 commit comments

Comments
 (0)