'use client'; import { X, Send } from 'lucide-react'; import { ThreadView, type ThreadItem } from './thread-view'; import { useState } from 'react'; interface ThreadDrawerProps { isOpen: boolean; onClose: () => void; title: string; id: string; items?: ThreadItem[]; embedded?: boolean; // New prop for embedded mode } // Sample data for demo const SAMPLE_ITEMS: ThreadItem[] = [ { id: '1', type: 'status_change', from: 'backlog', to: 'in_progress', timestamp: new Date(Date.now() - 2 * 60 * 60 * 1000), }, { id: '2', type: 'comment', author: 'zenchantlive', content: 'Started working on this task.', timestamp: new Date(Date.now() - 1 * 60 * 60 * 1000), }, { id: '3', type: 'protocol_event', event: 'HANDOFF', content: 'Handed off to agent', timestamp: new Date(Date.now() - 30 * 60 * 1000), }, ]; export function ThreadDrawer({ isOpen, onClose, title, id, items = SAMPLE_ITEMS, embedded = false }: ThreadDrawerProps) { const [comment, setComment] = useState(''); if (!isOpen) return null; return (
{/* Header: Mission Control Style */}
MISSION_{id}

{title}

{/* Thread Content */}
{/* Compose: Technical Input Field */}
setComment(e.target.value)} placeholder="Transmit message..." className="flex-1 bg-transparent px-3 py-2 text-sm text-white placeholder:text-text-muted/30 outline-none" onKeyDown={(e) => { if (e.key === 'Enter' && comment.trim()) { setComment(''); } }} />
Encrypted Channel_Active
); }