import { Check, Copy, ExternalLink, MessagesSquare } from 'lucide-react'; import React from 'react'; import { useTranslation } from '../../../i18n'; import { fs } from '../../shared/DialogShell'; import { Tooltip } from '../../shared/Tooltip'; import { SETTINGS_BUTTON_PRIMARY, SETTINGS_ICON_BUTTON, SettingsCard, SettingsHint } from '../settingsKit'; import { CLAUDE_CONNECTOR_ANCHOR } from './aiConnectModel'; import { useClaudeConnector } from './useClaudeConnector'; type ClaudeConnector = ReturnType; /** The way in: the button that adds TREK on claude.ai, the address to copy, and the QR code for a phone. */ function ConnectorLinks({ connector, qrSrc, copied, copyUrl, }: Omit & { connector: NonNullable }) { const { t } = useTranslation(); return (
{connector.mcpUrl}
{t('assistant.claude.qrAlt')}
{t('assistant.claude.scan')}
); } /** * "Connect with Claude": TREK as a connector inside Claude, over the MCP * server and its OAuth. One button adds it on claude.ai; the QR code does the * same from a phone, so it only shows where a phone is not already in hand. */ export default function ClaudeConnectorCard(): React.ReactElement { const { t } = useTranslation(); const { connector, reachable, ...links } = useClaudeConnector(); // Null keeps the card to its band until the address is known. let body: React.ReactNode = null; if (connector && reachable) body = ; else if (connector) body = {t('assistant.claude.notPublic')}; return ( {body} ); }