"use client"; import { useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import { cn } from "@/lib/utils"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Feature } from "@/store/app-store"; import { GripVertical, Edit, CheckCircle2, Circle, Loader2, Trash2, Eye, PlayCircle } from "lucide-react"; interface KanbanCardProps { feature: Feature; onEdit: () => void; onDelete: () => void; onViewOutput?: () => void; onVerify?: () => void; isCurrentAutoTask?: boolean; } export function KanbanCard({ feature, onEdit, onDelete, onViewOutput, onVerify, isCurrentAutoTask }: KanbanCardProps) { // Disable dragging if the feature is in progress or verified const isDraggable = feature.status === "backlog"; const { attributes, listeners, setNodeRef, transform, transition, isDragging, } = useSortable({ id: feature.id, disabled: !isDraggable, }); const style = { transform: CSS.Transform.toString(transform), transition, }; return ( {isCurrentAutoTask && (
Running...
)}
{feature.description} {feature.category}
{/* Steps Preview */} {feature.steps.length > 0 && (
{feature.steps.slice(0, 3).map((step, index) => (
{feature.status === "verified" ? ( ) : ( )} {step}
))} {feature.steps.length > 3 && (

+{feature.steps.length - 3} more steps

)}
)} {/* Actions */}
{isCurrentAutoTask && onViewOutput && ( )} {!isCurrentAutoTask && feature.status === "in_progress" && ( <> {onVerify && ( )} {onViewOutput && ( )} )} {!isCurrentAutoTask && feature.status !== "in_progress" && ( <> )}
); }