import { useState } from 'react' import { Modal } from '@/components/common/Modal' import { GitFork, Loader2 } from 'lucide-react' import { cn } from '@/lib/utils' interface ForkTreeModalProps { isOpen: boolean onClose: () => void originalTreeName: string onFork: (name: string, description: string) => Promise onSkip: () => void } export function ForkTreeModal({ isOpen, onClose, originalTreeName, onFork, onSkip }: ForkTreeModalProps) { const [name, setName] = useState(`${originalTreeName} (Custom)`) const [description, setDescription] = useState('') const [isSaving, setIsSaving] = useState(false) const [error, setError] = useState(null) const handleFork = async () => { if (!name.trim()) { setError('Please enter a name for your tree') return } setIsSaving(true) setError(null) try { await onFork(name.trim(), description.trim()) } catch (err) { setError('Failed to save tree. Please try again.') console.error(err) } finally { setIsSaving(false) } } const footer = (
) return (

You've created a custom troubleshooting path!

Save it as your own personal tree to reuse this troubleshooting flow in the future.

setName(e.target.value)} placeholder="My Custom Tree" className={cn( 'w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground', 'focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20' )} />