import { useState } from 'react' import { X } from 'lucide-react' import { cn } from '@/lib/utils' import type { HandoffCreateRequest } from '@/types/branching' interface HandoffModalProps { onClose: () => void onSubmit: (data: HandoffCreateRequest) => Promise } type HandoffIntent = 'park' | 'escalate' export function HandoffModal({ onClose, onSubmit }: HandoffModalProps) { const [intent, setIntent] = useState('park') const [notes, setNotes] = useState('') const [elevated, setElevated] = useState(false) const [isSubmitting, setIsSubmitting] = useState(false) async function handleSubmit() { setIsSubmitting(true) try { const data: HandoffCreateRequest = { intent, engineer_notes: notes.trim() || undefined, priority: intent === 'escalate' && elevated ? 'elevated' : 'normal', } await onSubmit(data) onClose() } finally { setIsSubmitting(false) } } return (
{/* Backdrop */}