import { useState } from "react"; import { api } from "@/lib/api"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"; import { ExternalLink, FileQuestion, Terminal } from "lucide-react"; interface ClaudeBinaryDialogProps { open: boolean; onOpenChange: (open: boolean) => void; onSuccess: () => void; onError: (message: string) => void; } export function ClaudeBinaryDialog({ open, onOpenChange, onSuccess, onError }: ClaudeBinaryDialogProps) { const [binaryPath, setBinaryPath] = useState(""); const [isValidating, setIsValidating] = useState(false); const handleSave = async () => { if (!binaryPath.trim()) { onError("Please enter a valid path"); return; } setIsValidating(true); try { await api.setClaudeBinaryPath(binaryPath.trim()); onSuccess(); onOpenChange(false); } catch (error) { console.error("Failed to save Claude binary path:", error); onError(error instanceof Error ? error.message : "Failed to save Claude binary path"); } finally { setIsValidating(false); } }; return ( Couldn't locate Claude Code installation

Claude Code was not found in any of the common installation locations. Please specify the path to the Claude binary manually.

Tip: Run{" "} which claude{" "} in your terminal to find the installation path

setBinaryPath(e.target.value)} onKeyDown={(e) => { if (e.key === "Enter" && !isValidating) { handleSave(); } }} autoFocus className="font-mono text-sm" />

Common locations: /usr/local/bin/claude, /opt/homebrew/bin/claude, ~/.claude/local/claude

); }