import { useState } from 'react' import { Modal } from '@/components/common/Modal' import { GitFork } from 'lucide-react' import { Button } from '@/components/ui/Button' import { Input } from '@/components/ui/Input' import { Textarea } from '@/components/ui/Textarea' 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" />