'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[]; } // 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 }: ThreadDrawerProps) { const [comment, setComment] = useState(''); if (!isOpen) return null; return (
{/* Header */}
{id}

{title}

{/* Thread Content */}
{/* Compose */}
setComment(e.target.value)} placeholder="Add a comment..." className="flex-1 px-3 py-2 rounded-md text-sm" style={{ backgroundColor: 'var(--color-bg-input)', color: 'var(--color-text-primary)', border: '1px solid rgba(255, 255, 255, 0.1)', }} onKeyDown={(e) => { if (e.key === 'Enter' && comment.trim()) { setComment(''); } }} />
); }