From cdb0bc7bf1d8721efe3590eda86600a7f6911d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Biro=C5=A1?= Date: Mon, 13 Oct 2025 11:16:06 +0200 Subject: [PATCH] Revert "fix: Remove Claude integration (#1989)" This reverts commit 228f3d46737c32f536a705e48db222999bebfe7a. --- .../src/theme/LLMButtons/index.jsx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/apify-docs-theme/src/theme/LLMButtons/index.jsx b/apify-docs-theme/src/theme/LLMButtons/index.jsx index 0a989935b..4e0aa6439 100644 --- a/apify-docs-theme/src/theme/LLMButtons/index.jsx +++ b/apify-docs-theme/src/theme/LLMButtons/index.jsx @@ -2,6 +2,7 @@ import clsx from 'clsx'; import React, { useCallback, useState } from 'react'; import { + AnthropicIcon, ChatGptIcon, CheckIcon, ChevronDownIcon, @@ -37,6 +38,13 @@ const DROPDOWN_OPTIONS = [ Icon: ChatGptIcon, value: 'openInChatGPT', }, + { + label: 'Open in Claude', + description: 'Ask questions about this page', + showExternalIcon: true, + Icon: AnthropicIcon, + value: 'openInClaude', + }, { label: 'Open in Perplexity', description: 'Ask questions about this page', @@ -70,6 +78,27 @@ const onOpenInChatGPTClick = () => { } }; +const onOpenInClaudeClick = () => { + if (window.analytics) { + window.analytics.track('Clicked', { + app: 'docs', + button_text: 'Open in Claude', + element: 'llm-buttons.openInClaude', + }); + } + + const prompt = getPrompt(window.location.href); + + try { + window.open( + `https://claude.ai/new?q=${encodeURIComponent(prompt)}`, + '_blank', + ); + } catch (error) { + console.error('Error opening Claude:', error); + } +}; + const onOpenInPerplexityClick = () => { if (window.analytics) { window.analytics.track('Clicked', { @@ -227,6 +256,9 @@ export default function LLMButtons({ isApiReferencePage = false }) { case 'openInChatGPT': onOpenInChatGPTClick(); break; + case 'openInClaude': + onOpenInClaudeClick(); + break; case 'openInPerplexity': onOpenInPerplexityClick(); break;