import React from "react"; import { RefreshCw } from "lucide-react"; import { useI18n } from "../../../../application/i18n/I18nProvider"; import { Button } from "../../../ui/button"; import { cn } from "../../../../lib/utils"; import type { AgentPathInfo } from "./types"; import { ProviderIconBadge } from "./ProviderIconBadge"; export const ClaudeCodeCard: React.FC<{ pathInfo: AgentPathInfo | null; isResolvingPath: boolean; customPath: string; onCustomPathChange: (path: string) => void; onRecheckPath: () => void; }> = ({ pathInfo, isResolvingPath, customPath, onCustomPathChange, onRecheckPath, }) => { const { t } = useI18n(); const found = pathInfo?.available; const statusText = isResolvingPath ? t('ai.claude.detecting') : found ? t('ai.claude.detected') : t('ai.claude.notFound'); const statusClassName = isResolvingPath ? "text-muted-foreground" : found ? "text-emerald-500" : "text-amber-500"; return (
{t('ai.claude.title')}

{t('ai.claude.description')}

{statusText}
{/* Path detection info */} {found ? (
{t('ai.claude.path')} {pathInfo.path} {pathInfo.version && ( <> | {pathInfo.version} )}
) : !isResolvingPath ? (

{t('ai.claude.notFoundHint')}

onCustomPathChange(e.target.value)} placeholder={t('ai.claude.customPathPlaceholder')} className="flex-1 h-8 rounded-md border border-input bg-background px-3 text-sm font-mono placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" />
) : null}
); };