Skip to content

Commit c8a4edd

Browse files
authored
fix: Revert remove Claude integration commit (#2003)
The Claude integrations started to work again. So reverting the commit that removed the Claude integration. This reverts commit 228f3d4.
1 parent 3a33357 commit c8a4edd

File tree

1 file changed

+32
-0
lines changed
  • apify-docs-theme/src/theme/LLMButtons

1 file changed

+32
-0
lines changed

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import clsx from 'clsx';
22
import React, { useCallback, useState } from 'react';
33

44
import {
5+
AnthropicIcon,
56
ChatGptIcon,
67
CheckIcon,
78
ChevronDownIcon,
@@ -37,6 +38,13 @@ const DROPDOWN_OPTIONS = [
3738
Icon: ChatGptIcon,
3839
value: 'openInChatGPT',
3940
},
41+
{
42+
label: 'Open in Claude',
43+
description: 'Ask questions about this page',
44+
showExternalIcon: true,
45+
Icon: AnthropicIcon,
46+
value: 'openInClaude',
47+
},
4048
{
4149
label: 'Open in Perplexity',
4250
description: 'Ask questions about this page',
@@ -70,6 +78,27 @@ const onOpenInChatGPTClick = () => {
7078
}
7179
};
7280

81+
const onOpenInClaudeClick = () => {
82+
if (window.analytics) {
83+
window.analytics.track('Clicked', {
84+
app: 'docs',
85+
button_text: 'Open in Claude',
86+
element: 'llm-buttons.openInClaude',
87+
});
88+
}
89+
90+
const prompt = getPrompt(window.location.href);
91+
92+
try {
93+
window.open(
94+
`https://claude.ai/new?q=${encodeURIComponent(prompt)}`,
95+
'_blank',
96+
);
97+
} catch (error) {
98+
console.error('Error opening Claude:', error);
99+
}
100+
};
101+
73102
const onOpenInPerplexityClick = () => {
74103
if (window.analytics) {
75104
window.analytics.track('Clicked', {
@@ -227,6 +256,9 @@ export default function LLMButtons({ isApiReferencePage = false }) {
227256
case 'openInChatGPT':
228257
onOpenInChatGPTClick();
229258
break;
259+
case 'openInClaude':
260+
onOpenInClaudeClick();
261+
break;
230262
case 'openInPerplexity':
231263
onOpenInPerplexityClick();
232264
break;

0 commit comments

Comments
 (0)