import { FeatureCard } from './FeatureCard' import { Plus, Sparkles, Wand2 } from 'lucide-react' import type { Feature, ActiveAgent } from '../lib/types' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' interface KanbanColumnProps { title: string count: number features: Feature[] allFeatures?: Feature[] activeAgents?: ActiveAgent[] color: 'pending' | 'progress' | 'done' onFeatureClick: (feature: Feature) => void onAddFeature?: () => void onExpandProject?: () => void showExpandButton?: boolean onCreateSpec?: () => void showCreateSpec?: boolean } const colorMap = { pending: 'border-t-4 border-t-muted', progress: 'border-t-4 border-t-primary', done: 'border-t-4 border-t-primary', } export function KanbanColumn({ title, count, features, allFeatures = [], activeAgents = [], color, onFeatureClick, onAddFeature, onExpandProject, showExpandButton, onCreateSpec, showCreateSpec, }: KanbanColumnProps) { // Create a map of feature ID to active agent for quick lookup // Maps ALL batch feature IDs to the same agent const agentByFeatureId = new Map() for (const agent of activeAgents) { const ids = agent.featureIds || [agent.featureId] for (const fid of ids) { agentByFeatureId.set(fid, agent) } } return ( {/* Header */} {title} {count} {(onAddFeature || onExpandProject) && (
{onAddFeature && ( )} {onExpandProject && showExpandButton && ( )}
)}
{/* Cards */}
{features.length === 0 ? (
{showCreateSpec && onCreateSpec ? (

No spec created yet

) : ( 'No features' )}
) : ( features.map((feature, index) => (
onFeatureClick(feature)} isInProgress={color === 'progress'} allFeatures={allFeatures} activeAgent={agentByFeatureId.get(feature.id)} />
)) )}
) }