diff --git a/frontend/src/components/session/HandoffModal.tsx b/frontend/src/components/session/HandoffModal.tsx new file mode 100644 index 00000000..4e2826ac --- /dev/null +++ b/frontend/src/components/session/HandoffModal.tsx @@ -0,0 +1,167 @@ +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 */} +